mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-05 19:42:20 +02:00
Improve waiting for sync
This commit is contained in:
parent
5f50845cdb
commit
24cd44db84
1 changed files with 3 additions and 1 deletions
|
@ -163,9 +163,11 @@ class SyncUtil (private val logic: AppLogic) {
|
|||
|
||||
suspend fun requestImportantSyncAndWait() {
|
||||
withContext (Dispatchers.Main) {
|
||||
val currentLastSync = lastSync.value
|
||||
|
||||
importantSyncRequested.value = true
|
||||
|
||||
importantSyncRequested.waitUntilValueMatches { it == false }
|
||||
lastSync.waitUntilValueMatches { it != currentLastSync }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue