mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 11:26:01 +03:00
crypto: Correctly continue backing up room keys
This commit is contained in:
parent
2b8783b489
commit
f9476f12af
1 changed files with 3 additions and 3 deletions
|
@ -812,7 +812,7 @@ internal class RustKeyBackupService @Inject constructor(
|
|||
* Send a chunk of keys to backup
|
||||
*/
|
||||
@UiThread
|
||||
private suspend fun backupKeys() {
|
||||
private suspend fun backupKeys(forceRecheck: Boolean = false) {
|
||||
Timber.v("backupKeys")
|
||||
|
||||
// Sanity check, as this method can be called after a delay, the state may have change during the delay
|
||||
|
@ -824,7 +824,7 @@ internal class RustKeyBackupService @Inject constructor(
|
|||
return
|
||||
}
|
||||
|
||||
if (state === KeysBackupState.BackingUp) {
|
||||
if (state === KeysBackupState.BackingUp && !forceRecheck) {
|
||||
// Do nothing if we are already backing up
|
||||
Timber.v("backupKeys: Invalid state: $state")
|
||||
return
|
||||
|
@ -856,7 +856,7 @@ internal class RustKeyBackupService @Inject constructor(
|
|||
|
||||
// TODO, again is this correct?
|
||||
withContext(Dispatchers.Main) {
|
||||
backupKeys()
|
||||
backupKeys(true)
|
||||
}
|
||||
} else {
|
||||
// Can't happen, do we want to panic?
|
||||
|
|
Loading…
Reference in a new issue