Skip to content

Commit 5189eb4

Browse files
authored
Merge pull request #4069 from element-hq/feature/bma/startSync
Always attempt to start the sync when starting the application.
2 parents a69b04e + c4fd20f commit 5189eb4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ import kotlinx.coroutines.flow.combine
8888
import kotlinx.coroutines.flow.debounce
8989
import kotlinx.coroutines.flow.launchIn
9090
import kotlinx.coroutines.flow.onEach
91+
import kotlinx.coroutines.flow.onStart
9192
import kotlinx.coroutines.launch
9293
import kotlinx.parcelize.Parcelize
9394
import timber.log.Timber
@@ -196,6 +197,10 @@ class LoggedInFlowNode @AssistedInject constructor(
196197
) { syncState, networkStatus ->
197198
Pair(syncState, networkStatus)
198199
}
200+
.onStart {
201+
// Temporary fix to ensure that the sync is started even if the networkStatus is offline.
202+
syncService.startSync()
203+
}
199204
.collect { (syncState, networkStatus) ->
200205
Timber.d("Sync state: $syncState, network status: $networkStatus")
201206
if (syncState != SyncState.Running && networkStatus == NetworkStatus.Online) {

0 commit comments

Comments
 (0)