diff options
| author | Adam Soltys <[email protected]> | 2026-08-04 00:56:11 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-04 00:56:11 -0700 |
| commit | cd1eab144f0ba56bb1a6460a7b25ed43aaa51e94 (patch) | |
| tree | ca3166fb14f26a95920f7b0a854ce64659e8f356 /src/app.js | |
| parent | c57c8dc347a024b51734f9bc5c8a348181b08754 (diff) | |
| download | coinosv3-cd1eab144f0ba56bb1a6460a7b25ed43aaa51e94.tar.gz coinosv3-cd1eab144f0ba56bb1a6460a7b25ed43aaa51e94.zip | |
A way back from the username step
Back from username (and sign-in) holds the auto-advance for the wallet
you backed away from, so welcome doesn't bounce you straight forward;
Get started then continues with the already-minted wallet instead of
minting another.
Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'src/app.js')
| -rw-r--r-- | src/app.js | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -2170,8 +2170,11 @@ function onboardScreen() { if (saved === 'signin') ui.nostrLoginOpen = true; // reopen the login card } const o = ui.onb; - // steps that were waiting on something advance the moment it exists - if ((o.step === 'welcome' || o.step === 'signin') && ui.screen === 'wallet' && activeAccount()) { + // Steps that were waiting on something advance the moment it exists — unless + // the user explicitly stepped back from username (heldFor remembers which + // wallet they backed away from); only a different wallet re-advances then. + if ((o.step === 'welcome' || o.step === 'signin') && ui.screen === 'wallet' && activeAccount() + && activeAccount().id !== o.heldFor) { o.step = 'username'; o.enterAddr = featureHook('namesAddress') || null; } @@ -2226,6 +2229,8 @@ function onboardScreen() { // Starting is the primary path; bringing a nostr account is the // alternative, offered here rather than as a question of its own. h('button', { class: 'btn-primary btn-block', style: 'font-size:17px;padding:14px', disabled: ui.onbBusy, onClick: async () => { + // back-tracked from username: the wallet is already minted, continue with it + if (activeAccount()) { o.heldFor = null; render(); return; } ui.onbBusy = true; render(); try { await enterWallet(newMnemonic(), '', { generated: true }); } catch (e) { ui.onbError = e.message; } ui.onbBusy = false; render(); @@ -2248,7 +2253,7 @@ function onboardScreen() { h('div', { class: 'onb-mark', html: NOSTR_MARK }), title(t('onbSigninTitle')), featureHook('unlockExtra') || h('div', { class: 'notice err' }, 'nostr login unavailable'), - h('button', { class: 'linklike small', onClick: () => { o.step = 'welcome'; render(); } }, t('back')), + h('button', { class: 'linklike small', onClick: () => { o.heldFor = activeAccount()?.id; o.step = 'welcome'; render(); } }, t('back')), ]); } if (o.step === 'username') { @@ -2263,6 +2268,7 @@ function onboardScreen() { // Most people are new. The ones who aren't know it, and can say so here // rather than everyone being asked first. h('button', { class: 'linklike small', onClick: () => { ui.onbError = ''; o.step = 'legacy'; render(); } }, t('onbHaveCoinos')), + h('button', { class: 'linklike small', onClick: () => { o.heldFor = activeAccount()?.id; o.step = 'welcome'; render(); } }, t('back')), ]); } if (o.step === 'avatar') { |
