fix: properly connect NostrConnectSigner on reconnection

- Call signer.connect() instead of forcing isConnected
- Add [bunker] logs for connect lifecycle
- Should unblock nip44/nip04 decrypt calls that were timing out
This commit is contained in:
Gigi
2025-10-16 22:55:17 +02:00
parent a352e2616e
commit 27ff4cef22

View File

@@ -43,9 +43,16 @@ export async function reconnectBunkerSigner(
if (!account.signer.listening) {
await account.signer.open()
}
// Mark as connected (bunker remembers permissions from initial connection)
account.signer.isConnected = true
// Ensure the signer is connected to the remote signer
// Important: do NOT set isConnected manually; establish connection properly
try {
console.log('[bunker] Connecting to bunker remote...')
await account.signer.connect()
console.log('[bunker] ✅ Connected to bunker remote')
} catch (err) {
console.error('[bunker] ❌ Failed to connect to bunker remote:', err)
}
// Expose nip04/nip44 at account level (like ExtensionAccount does)
if (!('nip04' in account)) {