From 1f8071e5d86104f5ad86d7d8f94f32daeda7fc76 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 18 Aug 2026 08:27:27 -0700 Subject: A missing signer opens a door instead of a toast: the reconnect screen offers the extension, the signer-app link, or a pasted key — same account enforced — and the silent reattach closes it on its own when it lands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz --- src/features/hats.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/features/hats.js') diff --git a/src/features/hats.js b/src/features/hats.js index 4f6e977..6516459 100644 --- a/src/features/hats.js +++ b/src/features/hats.js @@ -230,7 +230,11 @@ export function hatsFeature(ctx) { render(); try { const id = await identity(); - if (!id) throw new Error(t('msgNoIdentity')); + if (!id) { + if (!hook('nostrReconnectPrompt')) toast(t('msgNoIdentity')); + ui.hatBuying = null; ui.hatConfirm = null; render(); + return; + } const inv = await post('/hats/invoice', { hat: hat.id, net: hatNet() }, id.signer); await hook('arkPayInvoice', inv.invoice, { maxAmountSat: inv.sat }); const rec = await post('/hats/claim', { paymentHash: inv.paymentHash, hat: hat.id, net: hatNet() }, id.signer); @@ -252,7 +256,11 @@ export function hatsFeature(ctx) { render(); try { const id = await identity(); - if (!id) throw new Error(t('msgNoIdentity')); + if (!id) { + if (!hook('nostrReconnectPrompt')) toast(t('msgNoIdentity')); + ui.hatBuying = null; render(); + return; + } const rec = await post('/hats/equip', { hat: hatId, net: hatNet() }, id.signer); ui.hatShopData = { ...ui.hatShopData, owned: rec.owned, equipped: rec.equipped }; worn.set(hatNet() + ':' + id.pubkey, { hat: rec.equipped, t: Date.now() }); -- cgit v1.2.3