mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-05 19:08:23 +00:00
No need to recreate the client
This commit is contained in:
@@ -67,7 +67,7 @@ class Amber : Application() {
|
||||
val factory = OkHttpWebSocket.BuilderFactory { _, useProxy ->
|
||||
HttpClientManager.getHttpClient(useProxy)
|
||||
}
|
||||
var client: NostrClient = NostrClient(factory)
|
||||
val client: NostrClient = NostrClient(factory)
|
||||
var profileClient = ConcurrentHashMap<String, NostrClient>()
|
||||
val profileDataSource = ConcurrentHashMap<String, ProfileDataSource>()
|
||||
val applicationIOScope = CoroutineScope(Dispatchers.IO + SupervisorJob())
|
||||
@@ -255,10 +255,7 @@ class Amber : Application() {
|
||||
val hasNewRelays = allClientRelays.any { it.url !in savedUrls }
|
||||
|
||||
if (savedRelays.isEmpty()) {
|
||||
client.getAll().forEach {
|
||||
it.disconnect()
|
||||
}
|
||||
client = NostrClient(factory)
|
||||
client.reconnect(relays = null)
|
||||
NotificationDataSource.stop()
|
||||
AmberRelayStats.updateNotification()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user