fix: Back from Settings never lands on Settings itself (closes #481)
The recovery phrase and delete wallet screens take themselves off the Back stack when left, so Settings, one of those screens, then the settings gear leaves Settings under the Settings now showing. A reopened popup restores the same stack, cut at the screen the gear left. Back then showed Settings again and seemed to do nothing. goBack() now skips any entry for the screen already showing before it pops its target. Jest tests drive the gear and then Back for the recovery phrase screen, once and twice over, for both delete screens, and after a reopen. Model: opus-5-5
This commit is contained in:
@@ -1283,11 +1283,14 @@ behind a "···" menu.
|
||||
|
||||
Navigation uses a stack model (like iOS): each forward action pushes the current
|
||||
screen onto `state.viewStack`, and "Back" pops it (`pushCurrentView()` and
|
||||
`goBack()` in `src/popup/views/helpers.js`). The root screen is either Welcome
|
||||
(no wallets) or Home (has wallets). Each screen below gives its view id in
|
||||
parentheses; the registry of view ids is the `VIEWS` array in
|
||||
`src/popup/views/helpers.js`, and the markup for a screen is the element with id
|
||||
`view-` plus that view id in `src/popup/index.html`.
|
||||
`goBack()` in `src/popup/views/helpers.js`). "Back" skips an entry for the
|
||||
screen already showing: ShowRecoveryPhrase and the two delete screens take
|
||||
themselves off the stack when left, so the Settings gear on one of them leaves
|
||||
Settings under Settings, and "Back" from there goes to the screen before
|
||||
Settings. The root screen is either Welcome (no wallets) or Home (has wallets).
|
||||
Each screen below gives its view id in parentheses; the registry of view ids is
|
||||
the `VIEWS` array in `src/popup/views/helpers.js`, and the markup for a screen
|
||||
is the element with id `view-` plus that view id in `src/popup/index.html`.
|
||||
|
||||
Three elements sit outside the screens and are present on all of them: the title
|
||||
bar ("AutistMask by @sneak" plus the Settings gear), the flash message line
|
||||
|
||||
Reference in New Issue
Block a user