Skip to content
Snippets Groups Projects
Commit 29d17c11 authored by Kamal Bramwell's avatar Kamal Bramwell
Browse files

Update the last backup date after successful Crust backup

parent 0df9b19b
No related branches found
No related tags found
No related merge requests found
...@@ -111,7 +111,10 @@ class Crust private constructor( ...@@ -111,7 +111,10 @@ class Crust private constructor(
updateProgress() updateProgress()
crustApi.uploadBackup(backupService.backupFilePath).run { crustApi.uploadBackup(backupService.backupFilePath).run {
when { when {
isSuccess -> updateProgress(100) isSuccess -> {
updateProgress(100)
updateLastBackup(CrustBackupData.fromLatestBackup())
}
isFailure -> updateProgress(error = exceptionOrNull()) isFailure -> updateProgress(error = exceptionOrNull())
} }
} }
...@@ -137,5 +140,6 @@ private class CrustBackupData( ...@@ -137,5 +140,6 @@ private class CrustBackupData(
companion object Factory { companion object Factory {
fun from(backupData: AccountArchive) = CrustBackupData(backupData.data.size.toLong()) fun from(backupData: AccountArchive) = CrustBackupData(backupData.data.size.toLong())
fun fromLatestBackup() = CrustBackupData(1)
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment