Fix duplicate Nostr relay connections

Add check to prevent creating multiple WebSocket connections to the same relay when connect() is called multiple times during app startup.
This commit is contained in:
jack
2025-07-31 10:48:22 +02:00
parent c74d6ad75e
commit 6a9a1cdb3b
+5
View File
@@ -168,6 +168,11 @@ class NostrRelayManager: ObservableObject {
return
}
// Skip if we already have a connection object
if connections[urlString] != nil {
return
}
// Attempting to connect to Nostr relay
let session = URLSession(configuration: .default)