Skip to content

Commit 522324a

Browse files
committed
fix: call onCacheRestored earlier
1 parent b0a344b commit 522324a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class BackupRepo @Inject constructor(
301301
type = Toast.ToastType.ERROR,
302302
title = context.getString(R.string.settings__backup__failed_title),
303303
description = context.getString(R.string.settings__backup__failed_message).formatPlural(
304-
mapOf("interval" to (BACKUP_CHECK_INTERVAL / MINUTE_IN_MS)) // displayed in minutes
304+
mapOf("interval" to (BACKUP_CHECK_INTERVAL / MINUTE_IN_MS))
305305
),
306306
)
307307
}
@@ -406,9 +406,9 @@ class BackupRepo @Inject constructor(
406406
return@withContext try {
407407
performRestore(BackupCategory.METADATA) { dataBytes ->
408408
val parsed = json.decodeFromString<MetadataBackupV1>(String(dataBytes))
409-
db.tagMetadataDao().upsert(parsed.tagMetadata)
410409
cacheStore.update { parsed.cache }
411410
onCacheRestored()
411+
db.tagMetadataDao().upsert(parsed.tagMetadata)
412412
Logger.debug("Restored caches and ${parsed.tagMetadata.size} tags metadata records", TAG)
413413
}
414414

0 commit comments

Comments
 (0)