Skip to content

Commit

Permalink
Always initialize "hasBackupCodesPrinted" as true in Manage component
Browse files Browse the repository at this point in the history
  • Loading branch information
renintw committed Jun 6, 2023
1 parent 0c65885 commit 663d824
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions settings/src/components/backup-codes.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ function Manage( { setRegenerating } ) {
setHasBackupCodesPrinted,
},
} = useContext( GlobalContext );

// In Manage screen, always initialize "hasBackupCodesPrinted" as true.
// Otherwise, if users leave the account screen and return, it would default back to false, and the 'Back' button would be unclickable.
useEffect( () => setHasBackupCodesPrinted( true ), [] );

const remaining = record[ '2fa_backup_codes_remaining' ];

return (
Expand Down

0 comments on commit 663d824

Please sign in to comment.