aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-08 11:19:51 -0700
committerAdam Soltys <[email protected]>2026-09-08 11:19:51 -0700
commit6ea73cf4f8bad7384f8ead16a1aa6988ae46e545 (patch)
treefdb772246b56fdc0622fff3e9a25e10bab11e599 /src/app.js
parent7b444d6f0750b1ff316204dd5ec4425201c480e9 (diff)
downloadcoinosv3-6ea73cf4f8bad7384f8ead16a1aa6988ae46e545.tar.gz
coinosv3-6ea73cf4f8bad7384f8ead16a1aa6988ae46e545.zip
Add "Sign into another account" — switch identities without logging out.
The only way to move between identities (e.g. Adam via a Nostr remote signer and passkeyguy via passkey) was logout → forget all data → sign in again, which wipes every account. But the machinery to hold several accounts at once already exists: enterWallet/addOrGetAccount ADD an account (they don't replace), the unlock screen carries the sign-in doors (Nostr/passkey/Google via unlockExtra) plus a fromWallet Back button, activateAccount cleanly tears down and re-inits per-account nostr-login state, and the Accounts screen already switches between saved accounts. The nostr-login handoff even saves its session AFTER activating the new account, so each identity's signer state lands under its own namespace and resumes silently (persisted passkey sk / bunker session). The missing piece was a non-destructive entry point. Added a "Sign into another account" button on the Accounts screen that opens the unlock screen in additive mode (ui.fromWallet), so signing in adds the identity alongside the current one — then switching is just tapping a row on the Accounts screen (reached via the balance card's Accounts button), no logout, no data loss. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01MGzU12QrAA4G6BYGzGVdXz
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/app.js b/src/app.js
index 127fda4..e03e1a9 100644
--- a/src/app.js
+++ b/src/app.js
@@ -2573,6 +2573,15 @@ function accountsScreen() {
}))
),
h('button', { class: 'btn-block', onClick: () => { ui.addWallet = { kind: 'spending', from: 'new' }; render(); } }, t('addWallet')),
+ // Sign into a DIFFERENT identity (Nostr signer, passkey, Google) without
+ // logging out: the unlock screen carries the sign-in doors, and enterWallet
+ // ADDS the account alongside the current ones (fromWallet keeps them + a
+ // Back). Switching between them afterwards is just tapping a row above.
+ h('div', { class: 'col', style: 'gap:4px' },
+ h('button', { class: 'btn-ghost btn-block', onClick: () => {
+ ui.fromWallet = true; ui.unlockError = ''; ui.unlockTab = 'import'; ui.screen = 'unlock'; render();
+ } }, t('signInAnother')),
+ h('div', { class: 'small faint', style: 'padding:0 2px' }, t('signInAnotherNote'))),
hasVault() ? h('button', { class: 'btn-ghost btn-block', onClick: startChangePw }, t('changePassword')) : null,
h('button', { class: 'btn-ghost btn-block', onClick: () => { ui.confirmClear = true; render(); } }, t('clearAll'))
),