Update ConnectivityManagerNetworkMonitor.kt

pull/716/head
Simon Marquis 2 years ago committed by GitHub
parent 76c249a651
commit def5c4e881
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,11 +37,11 @@ class ConnectivityManagerNetworkMonitor @Inject constructor(
) : NetworkMonitor {
override val isOnline: Flow<Boolean> = callbackFlow {
val connectivityManager = context.getSystemService<ConnectivityManager>()
?: run {
channel.trySend(false)
channel.close()
return@callbackFlow
}
?: run {
channel.trySend(false)
channel.close()
return@callbackFlow
}
/**
* The callback's methods are invoked on changes to *any* network, not just the active

Loading…
Cancel
Save