diff options
| author | Adam Soltys <[email protected]> | 2026-09-08 11:19:51 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-08 11:19:51 -0700 |
| commit | 6ea73cf4f8bad7384f8ead16a1aa6988ae46e545 (patch) | |
| tree | fdb772246b56fdc0622fff3e9a25e10bab11e599 /src | |
| parent | 7b444d6f0750b1ff316204dd5ec4425201c480e9 (diff) | |
| download | coinosv3-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')
| -rw-r--r-- | src/app.js | 9 | ||||
| -rw-r--r-- | src/i18n.js | 2 |
2 files changed, 11 insertions, 0 deletions
@@ -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')) ), diff --git a/src/i18n.js b/src/i18n.js index 5b8cab6..2177385 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -43,6 +43,8 @@ const STR = { lockWallet: 'Lock wallet', accounts: 'Accounts', addWallet: 'Add account', + signInAnother: 'Sign into another account', + signInAnotherNote: 'Add a different identity (Nostr, passkey or Google) without signing out — switch between them here anytime.', clearAll: 'Delete all', logoutForget: 'Logout & forget all data', entropyToggle: 'Entropy', |
