RoomList: try syncing when network is back and inError state
This commit is contained in:
parent
7846fa19b4
commit
f3e072bdb0
6 changed files with 45 additions and 17 deletions
|
|
@ -37,6 +37,7 @@ import kotlinx.coroutines.flow.SharingStarted
|
|||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.callbackFlow
|
||||
import kotlinx.coroutines.flow.debounce
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.stateIn
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
|
@ -81,6 +82,7 @@ class NetworkMonitorImpl @Inject constructor(
|
|||
connectivityManager.unregisterNetworkCallback(callback)
|
||||
}
|
||||
}
|
||||
.distinctUntilChanged()
|
||||
.debounce(300)
|
||||
.stateIn(appCoroutineScope, SharingStarted.WhileSubscribed(), connectivityManager.activeNetworkStatus())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue