Quick question:
suspend fun waitForNetworkConnection() = isConnectedFlow.filter { it }.single()
isConnectedFlow
is a StateFlow, initially
false
(let’s assume we are in airplane mode in an Android app), then network connection is back,
isConnectedFlow.value = true
, however, the
waitForNetworkConnection
never ends and I don’t know why, I can see it only enters in the
filter
once and the second emission is ignored? I’ve also tried
isConnectedFlow.first { it }
to no avail. Any help would be appreciated