mirror of
https://github.com/dergigi/boris.git
synced 2026-01-08 17:34:52 +01:00
fix: setup pool and relays BEFORE bunker reconnection subscription
- Move NostrConnectSigner.pool assignment before active account subscription - Move pool.group(RELAYS) before subscription - This ensures pool is ready when bunker signer tries to send requests - The subscription can fire immediately, so pool must be configured first - Add log to confirm pool assignment
This commit is contained in:
17
src/App.tsx
17
src/App.tsx
@@ -221,6 +221,15 @@ function App() {
|
||||
|
||||
const pool = new RelayPool()
|
||||
|
||||
// Setup NostrConnectSigner to use the relay pool FIRST before any reconnections
|
||||
NostrConnectSigner.pool = pool
|
||||
console.log('[bunker] ✅ Pool assigned to NostrConnectSigner')
|
||||
|
||||
// Create a relay group for better event deduplication and management
|
||||
pool.group(RELAYS)
|
||||
console.log('Created relay group with', RELAYS.length, 'relays (including local)')
|
||||
console.log('Relay URLs:', RELAYS)
|
||||
|
||||
// Reconnect bunker signers when active account changes
|
||||
// Keep track of which accounts we've already reconnected to avoid double-connecting
|
||||
const reconnectedAccounts = new Set<string>()
|
||||
@@ -278,14 +287,6 @@ function App() {
|
||||
}
|
||||
})
|
||||
|
||||
// Setup NostrConnectSigner to use the relay pool
|
||||
NostrConnectSigner.pool = pool
|
||||
|
||||
// Create a relay group for better event deduplication and management
|
||||
pool.group(RELAYS)
|
||||
console.log('Created relay group with', RELAYS.length, 'relays (including local)')
|
||||
console.log('Relay URLs:', RELAYS)
|
||||
|
||||
// Keep all relay connections alive indefinitely by creating a persistent subscription
|
||||
// This prevents disconnection when no other subscriptions are active
|
||||
// Create a minimal subscription that never completes to keep connections alive
|
||||
|
||||
Reference in New Issue
Block a user