aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/hats.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-18 08:27:27 -0700
committerAdam Soltys <[email protected]>2026-08-18 08:27:27 -0700
commit1f8071e5d86104f5ad86d7d8f94f32daeda7fc76 (patch)
treee89c7b3b0bbcc797414104a63165a23276177e2d /src/features/hats.js
parentf684cee551fc2d2470f518332597dd9072a7da90 (diff)
downloadcoinosv3-1f8071e5d86104f5ad86d7d8f94f32daeda7fc76.tar.gz
coinosv3-1f8071e5d86104f5ad86d7d8f94f32daeda7fc76.zip
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
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz
Diffstat (limited to 'src/features/hats.js')
-rw-r--r--src/features/hats.js12
1 files changed, 10 insertions, 2 deletions
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() });