Solves some of the crashes of concurrent modification exception
This commit is contained in:
+3
-3
@@ -36,7 +36,7 @@ class RelayOfflineTracker(
|
|||||||
const val TAG = "RelayOfflineTracker"
|
const val TAG = "RelayOfflineTracker"
|
||||||
}
|
}
|
||||||
|
|
||||||
val cannotConnectRelays = mutableSetOf<NormalizedRelayUrl>()
|
var cannotConnectRelays = setOf<NormalizedRelayUrl>()
|
||||||
|
|
||||||
private val clientListener =
|
private val clientListener =
|
||||||
object : IRelayClientListener {
|
object : IRelayClientListener {
|
||||||
@@ -45,14 +45,14 @@ class RelayOfflineTracker(
|
|||||||
pingMillis: Int,
|
pingMillis: Int,
|
||||||
compressed: Boolean,
|
compressed: Boolean,
|
||||||
) {
|
) {
|
||||||
cannotConnectRelays.remove(relay.url)
|
cannotConnectRelays -= relay.url
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCannotConnect(
|
override fun onCannotConnect(
|
||||||
relay: IRelayClient,
|
relay: IRelayClient,
|
||||||
errorMessage: String,
|
errorMessage: String,
|
||||||
) {
|
) {
|
||||||
cannotConnectRelays.add(relay.url)
|
cannotConnectRelays += relay.url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user