diff options
| author | Adam Soltys <[email protected]> | 2026-09-10 13:49:52 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-10 13:49:52 -0700 |
| commit | d61b2be95db793d3d8d43b2158f5d514207cab09 (patch) | |
| tree | b5ffd921cd13a35a157273b4ec2a25e0912c999d | |
| parent | 7ff99d97a544e1665ddaafd8d80c0dd9ba3131ac (diff) | |
| download | coinosv3-d61b2be95db793d3d8d43b2158f5d514207cab09.tar.gz coinosv3-d61b2be95db793d3d8d43b2158f5d514207cab09.zip | |
Profile page gets "Sign into another account" beside Log out.
The additive sign-in door lived only at the foot of the Accounts screen; the
profile page — where people actually go looking for a way out of the current
identity — offered just Log out. Now it carries the same button, via a shared
signInAnother action on the feature ctx (clears the profile/chat state so the
unlock screen's Back lands on the wallet, and the new identity doesn't open
onto the old identity's profile).
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01URmfo8VimCNkw6Y7JndYrv
| -rw-r--r-- | src/app.js | 15 | ||||
| -rw-r--r-- | src/features/messages.js | 9 |
2 files changed, 21 insertions, 3 deletions
@@ -1316,6 +1316,16 @@ async function activateAccount(acc, opts = {}) { } // --- accounts ------------------------------------------------------------- + +// Open the unlock screen in ADDITIVE mode: the sign-in doors (Nostr signer, +// passkey, Google, pasted key/phrase) add the identity alongside the current +// accounts instead of replacing them, and Back returns to the wallet. Shared +// by the Accounts screen and the profile page. +function signInAnother() { + ui.fromWallet = true; ui.unlockError = ''; ui.unlockTab = 'import'; ui.screen = 'unlock'; + ui.profilePk = null; ui.profEdit = null; ui.profEditFilled = false; ui.chatOpen = false; + render(); +} // The working set of wallets you can switch between. Full (seed-bearing) // accounts live only in sessionStorage — ephemeral, wiped when the browser // closes (no seed on disk by default). Watch-only accounts hold just an xpub, @@ -2579,9 +2589,7 @@ function accountsScreen() { // 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('button', { class: 'btn-ghost btn-block', onClick: signInAnother }, 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')) @@ -4880,6 +4888,7 @@ const ctx = { // Routes through the Delete-all warning — never a single tap. // The popup has already shown the delete-everything warning by the time // this runs — wipe now and land on the front door. + signInAnother, logoutForget: () => { ui.profilePk = null; ui.profEdit = null; ui.profEditFilled = false; ui.chatOpen = false; ui.pubProf = null; diff --git a/src/features/messages.js b/src/features/messages.js index 1eb3e41..e85d5d7 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -2512,6 +2512,15 @@ export function messagesFeature(ctx) { } } }, t('profPostBtn')), h('button', { class: 'btn-ghost', onClick: () => { ui.profCompose = null; render(); } }, t('cancel')))), + // the non-destructive way out: add another identity (Nostr, + // passkey, Google) next to this one and switch between them + // on the Accounts screen — logout stays for actually leaving + ctx.signInAnother ? h('button', { + class: 'btn-block', style: 'display:flex;align-items:center;justify-content:center;gap:8px', + onClick: () => ctx.signInAnother(), + }, + h('span', { style: 'display:flex', html: '<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><line x1="19" y1="8" x2="19" y2="14"/><line x1="22" y1="11" x2="16" y2="11"/></svg>' }), + t('signInAnother')) : null, logoutBtn()) : ui.pubProf ? null // no wallet open: messaging and paying both need one |
