fix: Back from Settings no longer lands on a secret screen left by the gear (closes #461)
check / check (push) Successful in 6m59s
e2e / e2e-chrome (push) Successful in 5m17s
e2e / e2e-firefox (push) Successful in 3m11s

Leaving the private key export or recovery phrase screen drops the
selection it was showing, but the settings gear had just pushed the
screen onto the Back stack, so Back from Settings landed on a password
prompt that could only fail. Each screen's leave handler now also takes
it off the top of the stack, which is what a reopened popup already does
to these screens. Back from Settings goes to the address screen for the
export screen; for the recovery phrase screen, opened from Settings, it
stays on Settings once, as after a reopen.

Jest tests drive the gear and then Back, and each screen's own Back, for
both screens; leavePrivkeyScreen() in the e2e suite expects the address
screen.

Model: opus-5-5
This commit was merged in pull request #479.
This commit is contained in:
2026-10-07 01:43:07 +02:00
parent cd730241bb
commit e865099c5b
7 changed files with 160 additions and 12 deletions
+10 -1
View File
@@ -152,7 +152,16 @@ async function reveal() {
}
function init() {
onViewLeave(VIEW, clear);
// Leaving drops the address selection, so the screen also comes off the
// Back stack, where the settings gear has just put it: Back from Settings
// must not land on a password prompt that can only fail. A reopened popup
// drops it from the stack the same way
// (https://git.eeqj.de/sneak/AutistMask/issues/461).
onViewLeave(VIEW, () => {
clear();
const stack = state.viewStack;
if (stack[stack.length - 1] === VIEW) stack.pop();
});
// No wipe here: goBack() routes through showView(), which runs the
// leave hook. A per-button wipe would only cover this one path.
+10 -1
View File
@@ -134,7 +134,16 @@ async function reveal() {
}
function init() {
onViewLeave(VIEW, clear);
// Leaving drops the wallet selection, so the screen also comes off the
// Back stack, where the settings gear has just put it: Back from Settings
// must not land on a password prompt that can only fail. A reopened popup
// drops it from the stack the same way
// (https://git.eeqj.de/sneak/AutistMask/issues/461).
onViewLeave(VIEW, () => {
clear();
const stack = state.viewStack;
if (stack[stack.length - 1] === VIEW) stack.pop();
});
$("btn-show-phrase-back").addEventListener("click", () => {
goBack();