Enable Offline mode of the SyncService, so that the sync starts automatically when the network is back.

Also rely on the sync state to render the "Offline" banner.
This commit is contained in:
Benoit Marty 2025-02-03 17:47:35 +01:00
parent cd6b0a43da
commit 0409ed84ed
20 changed files with 91 additions and 74 deletions

View file

@ -14,3 +14,11 @@ enum class SyncState {
Terminated,
Offline,
}
fun SyncState.isConnected() = when (this) {
SyncState.Idle,
SyncState.Running,
SyncState.Error,
SyncState.Terminated -> true
SyncState.Offline -> false
}