diff options
Diffstat (limited to 'src/features')
| -rw-r--r-- | src/features/messages.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 3bccd31..64e36c5 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -8385,6 +8385,21 @@ export function messagesFeature(ctx) { // Your own posts and messages too: a zap to yourself is a harmless // round-trip, and one bar that behaves the same everywhere beats a special case. const canZapPk = (pk) => !!pk && !isVisitor() && !!(hook('arkReady') || hook('canLnZap')); // a visitor's tap asks them in instead + // A locked wallet — the watch-only view of a sealed vault, or an identity + // signed in over one — has no keys to pay with. The tap says so and opens + // the Accounts page (the padlock, and the way to add the wallet, are + // there); the feed is remembered for the way back. It used to do nothing + // at all: the button pressed, the cursor an arrow. + function zapLockedAsk() { + toast('\u{1F512} ' + t('zapLocked'), 4000); + // the open feed, for the way back: by its URL when it has one, by its + // id otherwise (Following lives at no address) + const def = ui.chatOpen && ui.msgView === 'feed' ? feedDef() : null; + const back = def ? feedPath(def) || 'feed:' + def.id : null; + try { sessionStorage.setItem(RETURN_KEY, back || location.pathname + location.search); } catch {} + ui.screen = 'accounts'; + render(); + } function zapNote(pk, ev, origin) { const npubStr = npubOf(pk); const def = ctx.zapDefaultSat ? ctx.zapDefaultSat() : 0; @@ -9594,7 +9609,7 @@ export function messagesFeature(ctx) { // always in the bar — the same row of buttons on every post, so nothing // shifts when a wallet comes online; without one it is just the number btn(I_ZAP, zapLabel, zapSats ? fmtSats(zapSats) : 0, zapMine, - (zapHold && zapHold.onClick) || (isVisitor() ? () => signinAsk() : null), + (zapHold && zapHold.onClick) || (isVisitor() ? () => signinAsk() : wallet.watchOnly ? zapLockedAsk : null), 'note-zap' + (zapMine ? ' zapped' : '') + (zapFlying ? ' flying' : ''), zapHold && { ...zapHold, onClick: undefined }), // who did all that: a small chevron, always in place — dimmed until @@ -11068,6 +11083,7 @@ export function messagesFeature(ctx) { if (!back) return; setTimeout(() => { try { + if (back.startsWith('feed:')) { showFeed(back.slice(5)); render(); return; } const [path, q] = back.split('?'); if (/^\/feed(\/|$)/i.test(path)) { openFeedUrl(path.replace(/^\/feed\/?/i, ''), q ? '?' + q : ''); return; } const pk = parseNostrPubkey(path.replace(/^\//, '')); |
