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
33import org.gradle.api.tasks.testing.logging.TestLogEvent
44
55plugins {
6- kotlin(" multiplatform" ) version " 1.5.31 " apply false
6+ kotlin(" multiplatform" ) version " 1.5.32 " apply false
77 id(" base" )
88}
99
@@ -17,7 +17,7 @@ buildscript {
1717 }
1818 }
1919 dependencies {
20- classpath(" com.android.tools.build:gradle:7.0.3 " )
20+ classpath(" com.android.tools.build:gradle:7.0.4 " )
2121 classpath(" com.adarshr:gradle-test-logger-plugin:2.1.1" )
2222 }
2323}
Original file line number Diff line number Diff line change @@ -129,9 +129,9 @@ kotlin {
129129 apiVersion = " 1.5"
130130 languageVersion = " 1.5"
131131 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")
135135 }
136136 }
137137
Original file line number Diff line number Diff line change @@ -192,15 +192,19 @@ actual class DatabaseReference internal constructor(
192192 val deferred = CompletableDeferred <DataSnapshot >()
193193 android.runTransaction(object : Transaction .Handler {
194194
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+ }
197201
198202 override fun onComplete (
199203 error : DatabaseError ? ,
200204 committed : Boolean ,
201205 snapshot : com.google.firebase.database.DataSnapshot ?
202206 ) {
203- if (error != null ) {
207+ if (error != null ) {
204208 deferred.completeExceptionally(error.toException())
205209 } else {
206210 deferred.complete(DataSnapshot (snapshot!! ))
You can’t perform that action at this time.
0 commit comments