mirror of
https://github.com/dergigi/boris.git
synced 2026-02-23 16:04:29 +01:00
fix: recreate NostrConnectSigner with pool on account restore
- Restored signers from JSON don't have pool context - Recreate signer with pool passed explicitly to fix subscriptionMethod binding - This ensures signing requests are properly sent/received through the pool - Fixes hanging on signing after page reload
This commit is contained in:
15
src/App.tsx
15
src/App.tsx
@@ -273,6 +273,21 @@ function App() {
|
||||
})
|
||||
|
||||
try {
|
||||
// For restored signers, ensure they have the pool's subscription methods
|
||||
// The signer was created in fromJSON without pool context, so we need to recreate it
|
||||
const signerData = nostrConnectAccount.toJSON().signer
|
||||
const recreatedSigner = new NostrConnectSigner({
|
||||
relays: signerData.relays,
|
||||
pubkey: nostrConnectAccount.pubkey,
|
||||
remote: signerData.remote,
|
||||
signer: nostrConnectAccount.signer.signer, // Use the existing SimpleSigner
|
||||
pool: pool
|
||||
})
|
||||
|
||||
// Replace the signer on the account
|
||||
nostrConnectAccount.signer = recreatedSigner
|
||||
console.log('[bunker] ✅ Signer recreated with pool context')
|
||||
|
||||
// Add bunker's relays to the pool so signing requests can be sent/received
|
||||
const bunkerRelays = nostrConnectAccount.signer.relays || []
|
||||
const existingRelayUrls = new Set(Array.from(pool.relays.keys()))
|
||||
|
||||
Reference in New Issue
Block a user