We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc3f0c7 commit 2438d15Copy full SHA for 2438d15
firebase-database/src/androidMain/kotlin/dev/teamhub/firebase/database/database.kt
@@ -27,15 +27,10 @@ suspend fun <T> Task<T>.awaitWhileOnline(): T = coroutineScope {
27
.filter { !it.value<Boolean>() }
28
.produceIn(this)
29
30
- try {
31
- select<T> {
32
- asDeferred().onAwait { it }
33
- notConnected.onReceive { throw DatabaseException("Database not connected") }
34
- }
35
- } finally {
36
- notConnected.cancel()
+ select<T> {
+ asDeferred().onAwait { it.also { notConnected.cancel() } }
+ notConnected.onReceive { throw DatabaseException("Database not connected") }
37
}
38
-
39
40
41
actual val Firebase.database
0 commit comments