mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 02:25:20 +00:00
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:
@@ -168,6 +168,11 @@ class NostrRelayManager: ObservableObject {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip if we already have a connection object
|
||||||
|
if connections[urlString] != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Attempting to connect to Nostr relay
|
// Attempting to connect to Nostr relay
|
||||||
|
|
||||||
let session = URLSession(configuration: .default)
|
let session = URLSession(configuration: .default)
|
||||||
|
|||||||
Reference in New Issue
Block a user