Stalruth / porysearch

A website that displays a given Pokemon's stats, moves, abilities, and more!
http://stalruth.github.io/porysearch/
GNU General Public License v2.0
1 stars 0 forks source link

Issue with "Caught" feature. #5

Closed t-mathis closed 9 years ago

t-mathis commented 9 years ago

Adding then removing from the "Pokemon" tab does not remove entries from the "Caught" tab. Here's the steps I took to make this happen: 1) Refresh the page. 2) Mark Bulbasaur as "Caught" from the "Pokemon" tab using the pokeball. 3) Validate that Bulbasaur was added under "Caught" and it displays 1 caught Pokemon. 4) Unmark Bulbasaur as "Caught" from the "Pokemon" tab using the gray pokeball. 5) Bulbasaur remains under the "Caught" tab but it will display 0 caught Pokemon.

Continuing to repeat steps 2 and 4 will cause more "ghost" Bulbasaur entries to appear. Clicking on the gray pokeball on these ghost entries on the "Caught" tab doesn't do anything. I attached a screenshot, hopefully.

porysearch_bug_1

Stalruth commented 9 years ago

Thanks for the (really detailed) bug report! I think it's worth noting that the ghost entries disappear on refresh, which means that they are getting cleared from local storage, but aren't being deleted from the table for whatever reason.

Stalruth commented 9 years ago

Hold that - the fix doesn't work for loading caught pokemon from local storage, as the fix assigns them all the same ID on page load.

Stalruth commented 9 years ago

Scrub that, I forgot what the bug even was! It seems to be in that the initialize function of CaughtTableRow is using the last entry in localstorage for all but actually filling in the template, so if you set Bulbasaur, Ivysaur, and Venusaur as caught, they'll display as Bulbasaur, Ivysaur, and Venusaur but have the same ID (caughtPokemon-venusaur)