mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-09 23:16:50 +02:00
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".
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user