mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-29 01:42:33 +02:00
Waits 500ms before restarting all connections.
This commit is contained in:
@@ -58,6 +58,7 @@ import kotlinx.coroutines.GlobalScope
|
|||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import kotlinx.coroutines.SupervisorJob
|
import kotlinx.coroutines.SupervisorJob
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
|
import kotlinx.coroutines.flow.collectLatest
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@Stable
|
@Stable
|
||||||
@@ -112,7 +113,8 @@ class ServiceManager {
|
|||||||
collectorJob = null
|
collectorJob = null
|
||||||
collectorJob =
|
collectorJob =
|
||||||
scope.launch {
|
scope.launch {
|
||||||
myAccount.connectToRelaysFlow.collect {
|
myAccount.connectToRelaysFlow.collectLatest {
|
||||||
|
delay(500)
|
||||||
if (isStarted) {
|
if (isStarted) {
|
||||||
Client.reconnect(it, onlyIfChanged = true)
|
Client.reconnect(it, onlyIfChanged = true)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user