diff options
| author | Adam Soltys <[email protected]> | 2026-08-02 22:51:04 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-02 22:51:04 -0700 |
| commit | 9fc039dd6b2b8168056d7118cab29d58a303f282 (patch) | |
| tree | 6ef07cdf374c0b5daf452a911f22fe1e0f0c56cc /src/app.js | |
| parent | 36b84eed060a196d99ef83ded19c5f9a8ee2d0ba (diff) | |
| download | coinosv3-9fc039dd6b2b8168056d7118cab29d58a303f282.tar.gz coinosv3-9fc039dd6b2b8168056d7118cab29d58a303f282.zip | |
Header menu survives watch-only wallets
A watch-only wallet has no nostr identity, and the whole avatar menu —
including Settings and Logout — vanished with it. The menu now shows a
neutral face and keeps the keyless items; Edit profile and Messages
appear only when an identity exists.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi
Diffstat (limited to 'src/app.js')
| -rw-r--r-- | src/app.js | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1344,8 +1344,13 @@ function lock() { // cache + punk fallback); without that feature there's no menu. function avatarMenu() { const me = (featureHook('nostrLoginIdentity') || {}).pubkey || (wallet.nostrPubkey && wallet.nostrPubkey()); - const node = me && featureHook('headerAvatar', me); - if (!node) return null; + // No identity (watch-only wallet): the menu still exists — Settings and + // Logout don't need keys — behind a neutral face. + const node = (me && featureHook('headerAvatar', me)) + || h('span', { + class: 'chat-avatar header-ava fallback', + html: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>', + }); const item = (label, fn) => h('button', { class: 'icon-select-item', onClick: () => { ui.avatarMenu = false; fn(); render(); }, @@ -1356,9 +1361,9 @@ function avatarMenu() { ? h('span', {}, h('div', { class: 'menu-backdrop', onClick: () => { ui.avatarMenu = false; render(); } }), h('div', { class: 'icon-select-menu avatar-menu' }, - item(t('profEdit'), () => featureHook('showProfile', me)), + me ? item(t('profEdit'), () => featureHook('showProfile', me)) : null, item(t('tabSettings'), () => { ui.chatOpen = false; ui.profilePk = null; ui.screen = 'wallet'; ui.tab = 'settings'; ui.settingsPage = null; }), - item(t('msgDmsTitle'), () => { ui.profilePk = null; ui.chatOpen = true; }), + me ? item(t('msgDmsTitle'), () => { ui.profilePk = null; ui.chatOpen = true; }) : null, item(t('logout'), () => lock()))) : null); } |
