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
cd6b0a43da
commit
0409ed84ed
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