Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
This PR fixes the bug as explained in issue #17, the changes are simple:
reset()
function in thesrc/components/app.jsx
file. Previously, it was made to reset thecurrentDetails
value tobeginners-wish
in the React state variable (I believe this is the cause of the problem). I fixed the problem by removing thecurrentDetails
and adding theselectedWish
state variable whose value is the current banner that the user is browsing on when he/she clicked the reset button.else
statement in thesrc/components/banners.jsx
to not set theselectedBanner
state variable tobeginners-wish
. That way, when we clicked the reset button, we will still remain in our currently selected banner, not scrolling back to the Beginner's Wish.I have tested it in my web server (this includes last PR (#16) changes), and it works like a charm! No more switching to the beginner's wish if we rolled after clicking the reset button!
Don't forget to re-run
npm run build
after merging my previous and this PR, because I made this PR based on yourmaster
branch, not mycache-busting-improvements
branch 😅.I think that's all. Hope it helps and thank you!
Resolves #17