File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed
src/androidMain/kotlin/dev/gitlive/firebase/database Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
3
3
import org.gradle.api.tasks.testing.logging.TestLogEvent
4
4
5
5
plugins {
6
- kotlin(" multiplatform" ) version " 1.5.31 " apply false
6
+ kotlin(" multiplatform" ) version " 1.5.32 " apply false
7
7
id(" base" )
8
8
}
9
9
@@ -17,7 +17,7 @@ buildscript {
17
17
}
18
18
}
19
19
dependencies {
20
- classpath(" com.android.tools.build:gradle:7.0.3 " )
20
+ classpath(" com.android.tools.build:gradle:7.0.4 " )
21
21
classpath(" com.adarshr:gradle-test-logger-plugin:2.1.1" )
22
22
}
23
23
}
Original file line number Diff line number Diff line change @@ -129,9 +129,9 @@ kotlin {
129
129
apiVersion = " 1.5"
130
130
languageVersion = " 1.5"
131
131
progressiveMode = true
132
- optIn(" kotlinx.coroutines.ExperimentalCoroutinesApi" )
133
- optIn(" kotlinx.coroutines.FlowPreview" )
134
- optIn(" kotlinx.serialization.InternalSerializationApi" )
132
+ // optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
133
+ // optIn("kotlinx.coroutines.FlowPreview")
134
+ // optIn("kotlinx.serialization.InternalSerializationApi")
135
135
}
136
136
}
137
137
Original file line number Diff line number Diff line change @@ -192,15 +192,19 @@ actual class DatabaseReference internal constructor(
192
192
val deferred = CompletableDeferred <DataSnapshot >()
193
193
android.runTransaction(object : Transaction .Handler {
194
194
195
- override fun doTransaction (currentData : MutableData ) =
196
- Transaction .success(transactionUpdate(decode(strategy, currentData)) as MutableData )
195
+ override fun doTransaction (currentData : MutableData ): Transaction .Result {
196
+ currentData.value = currentData.value?.let {
197
+ transactionUpdate(decode(strategy, it))
198
+ }
199
+ return Transaction .success(currentData)
200
+ }
197
201
198
202
override fun onComplete (
199
203
error : DatabaseError ? ,
200
204
committed : Boolean ,
201
205
snapshot : com.google.firebase.database.DataSnapshot ?
202
206
) {
203
- if (error != null ) {
207
+ if (error != null ) {
204
208
deferred.completeExceptionally(error.toException())
205
209
} else {
206
210
deferred.complete(DataSnapshot (snapshot!! ))
You can’t perform that action at this time.
0 commit comments