Skip to content

Commit b5aace7

Browse files
committed
fix reset backups first on wipe
1 parent 56dbf88 commit b5aace7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

app/src/main/java/to/bitkit/repositories/BackupRepo.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ class BackupRepo @Inject constructor(
6767

6868
private var lastNotificationTime = 0L
6969

70-
fun reset() = vssBackupClient.reset()
70+
fun reset() {
71+
stopObservingBackups()
72+
vssBackupClient.reset()
73+
}
7174

7275
fun startObservingBackups() {
7376
if (isObserving) return

app/src/main/java/to/bitkit/repositories/WalletRepo.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,13 @@ class WalletRepo @Inject constructor(
238238
}
239239

240240
suspend fun wipeWallet(walletIndex: Int = 0): Result<Unit> = withContext(bgDispatcher) {
241-
backupRepo.stopObservingBackups()
242-
243241
try {
242+
backupRepo.reset()
243+
244244
_walletState.update { WalletState() }
245245
_balanceState.update { BalanceState() }
246246

247247
keychain.wipe()
248-
backupRepo.reset()
249248
db.clearAllTables()
250249
settingsStore.reset()
251250
cacheStore.reset()

0 commit comments

Comments
 (0)