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:
parent
f4afda119b
commit
f84aa03605
20 changed files with 91 additions and 74 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue