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:
+8
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user