mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 11:26:01 +03:00
Replaces writeAsync with awaitTransaction
This commit is contained in:
parent
90b063f0de
commit
8eab24c53d
1 changed files with 3 additions and 2 deletions
|
@ -28,6 +28,7 @@ import org.matrix.android.sdk.internal.session.sync.model.accountdata.toMutable
|
|||
import org.matrix.android.sdk.internal.session.user.UserEntityFactory
|
||||
import org.matrix.android.sdk.internal.session.user.accountdata.DirectChatsHelper
|
||||
import org.matrix.android.sdk.internal.session.user.accountdata.UpdateUserAccountDataTask
|
||||
import org.matrix.android.sdk.internal.util.awaitTransaction
|
||||
import javax.inject.Inject
|
||||
|
||||
internal class SyncResponsePostTreatmentAggregatorHandler @Inject constructor(
|
||||
|
@ -91,9 +92,9 @@ internal class SyncResponsePostTreatmentAggregatorHandler @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun List<User>.saveLocally() {
|
||||
private suspend fun List<User>.saveLocally() {
|
||||
val userEntities = map { user -> UserEntityFactory.create(user) }
|
||||
monarchy.writeAsync {
|
||||
monarchy.awaitTransaction {
|
||||
it.insertOrUpdate(userEntities)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue