Fix unable to see the first set of backup code - using localStroage #221
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.
Fixes #216
Clear comparison without disturbance from reverting: 2f6c51e...fix/Unable-to-see-the-first-set-of-backup-code
Before deploying #217, more cases were tested and a missing scenario was found: when leaving the account page and returning, the
isSetupFinished
state gets reset (as the 2FA component is unmounted), which leads to the direct generation of new backup codes upon entering the backup-codes screen again. Initially, I didn't want to use localStorage due to the concerns mentieond below. However, it appears an efficient way to reoslve this issue.But if we feel that the troubles caused by these concerns outweigh the inconvenience of not being able to see the first set of codes and considering that the upstream issue #507 can reach a consensus and be fixed soon, then I believe no modifications are necessary for addressing this issue.
Concerns about localStorage
localStorage.removeItem('key')
once we don't the key anymore.