fix: Back from Settings no longer lands on a secret screen left by the gear (closes #461)
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 is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user