Skip to content

Commit

Permalink
- reconnect services on reconnection for a resilient experience
Browse files Browse the repository at this point in the history
  • Loading branch information
rodvar committed Jan 17, 2025
1 parent 9cd3563 commit c4f537c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package network.bisq.mobile.client

import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import network.bisq.mobile.client.websocket.WebSocketClientProvider
import network.bisq.mobile.domain.UrlLauncher
Expand Down Expand Up @@ -41,13 +42,17 @@ class ClientMainPresenter(
webSocketClientProvider.get().connected.collect {
if (webSocketClientProvider.get().isConnected()) {
log.d { "connectivity status changed to $it - reconnecting services" }
deactivateServices()
activateServices()
reactiveServices()
}
}
}
}

private fun reactiveServices() {
deactivateServices()
activateServices()
}

private fun activateServices() {
runCatching {
applicationBootstrapFacade.activate()
Expand Down

0 comments on commit c4f537c

Please sign in to comment.