mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
Fix sync state progress bar
This commit is contained in:
parent
977721881f
commit
7e3b300130
1 changed files with 6 additions and 3 deletions
|
@ -54,8 +54,9 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask,
|
|||
updateStateTo(SyncState.IDLE)
|
||||
}
|
||||
|
||||
fun setInitialForeground(initialForground : Boolean) {
|
||||
updateStateTo(if (initialForground) SyncState.IDLE else SyncState.PAUSED)
|
||||
fun setInitialForeground(initialForeground: Boolean) {
|
||||
val newState = if (initialForeground) SyncState.IDLE else SyncState.PAUSED
|
||||
updateStateTo(newState)
|
||||
}
|
||||
|
||||
fun restart() = synchronized(lock) {
|
||||
|
@ -96,7 +97,9 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask,
|
|||
lock.wait()
|
||||
}
|
||||
} else {
|
||||
if (state !is SyncState.RUNNING) {
|
||||
updateStateTo(SyncState.RUNNING(catchingUp = true))
|
||||
}
|
||||
Timber.v("[$this] Execute sync request with timeout $DEFAULT_LONG_POOL_TIMEOUT")
|
||||
val latch = CountDownLatch(1)
|
||||
val params = SyncTask.Params(DEFAULT_LONG_POOL_TIMEOUT)
|
||||
|
|
Loading…
Reference in a new issue