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