aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-02 22:51:04 -0700
committerAdam Soltys <[email protected]>2026-08-02 22:51:04 -0700
commit9fc039dd6b2b8168056d7118cab29d58a303f282 (patch)
tree6ef07cdf374c0b5daf452a911f22fe1e0f0c56cc /src
parent36b84eed060a196d99ef83ded19c5f9a8ee2d0ba (diff)
downloadcoinosv3-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')
-rw-r--r--src/app.js13
-rw-r--r--src/style.css1
2 files changed, 10 insertions, 4 deletions
diff --git a/src/app.js b/src/app.js
index f2955da..c7e488e 100644
--- a/src/app.js
+++ b/src/app.js
@@ -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);
}
diff --git a/src/style.css b/src/style.css
index 2a2cf4c..ca85a8c 100644
--- a/src/style.css
+++ b/src/style.css
@@ -405,3 +405,4 @@ hr.divider { margin: 16px 0; }
.avatar-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 41; min-width: 170px; }
.chat-avatar.fallback.loading { background: var(--surface2); }
.wallet-row-btn { font-size: 19px; line-height: 1; padding: 8px 12px; }
+.chat-avatar.header-ava.fallback { align-items: center; justify-content: center; display: flex; color: var(--muted); }