From 9f341a48b6d734db304896887c8d808cbfde8fba Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Jan 2026 10:23:32 +0000 Subject: [PATCH] fix: set NostrConnectSigner pool before loading accounts Fixes crash on reload when a NIP-46 account is saved. The pool must be configured globally before accounts are restored from localStorage, otherwise NostrConnectSigner throws "Missing subscriptionMethod". --- src/services/accounts.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/services/accounts.ts b/src/services/accounts.ts index ff4080c..1789100 100644 --- a/src/services/accounts.ts +++ b/src/services/accounts.ts @@ -1,5 +1,7 @@ import { AccountManager } from "applesauce-accounts"; import { registerCommonAccountTypes } from "applesauce-accounts/accounts"; +import { NostrConnectSigner } from "applesauce-signers"; +import pool from "./relay-pool"; const ACCOUNTS = "nostr-accounts"; const ACTIVE_ACCOUNT = "active-account"; @@ -15,6 +17,10 @@ function safeParse(s: string) { const accountManager = new AccountManager(); registerCommonAccountTypes(accountManager); +// Set up NostrConnectSigner pool BEFORE loading accounts +// This is required for NIP-46 accounts to restore properly +NostrConnectSigner.pool = pool; + // load all accounts if (localStorage.getItem(ACCOUNTS)) { const accounts = localStorage.getItem(ACCOUNTS);