fix: pass permissions on reconnect to ensure decrypt allowed

- Call signer.connect(undefined, permissions) when restoring account
- Ensures bunker re-grants decrypt (nip04/nip44) if needed
- Keeps implementation aligned with applesauce examples
This commit is contained in:
Gigi
2025-10-16 23:06:06 +02:00
parent 769484bc0d
commit 905296621c

View File

@@ -48,7 +48,8 @@ export async function reconnectBunkerSigner(
// Important: do NOT set isConnected manually; establish connection properly
try {
console.log('[bunker] Connecting to bunker remote...')
await account.signer.connect()
// Re-request permissions on reconnect to ensure decrypt is allowed
await account.signer.connect(undefined, getDefaultBunkerPermissions())
console.log('[bunker] ✅ Connected to bunker remote')
} catch (err) {
console.error('[bunker] ❌ Failed to connect to bunker remote:', err)