Implement new top-level backups settings.

This commit is contained in:
Alex Hart
2024-09-27 11:04:57 -03:00
committed by GitHub
parent ea33fa2af1
commit 5bdc7c2740
25 changed files with 870 additions and 618 deletions

View File

@@ -105,6 +105,7 @@ object BackupRepository {
403 -> {
Log.w(TAG, "Received status 403. The user is not in the media tier. Updating local state.", error.exception)
SignalStore.backup.backupTier = MessageBackupTier.FREE
SignalStore.uiHints.markHasEverEnabledRemoteBackups()
// TODO [backup] If the user thought they were in media tier but aren't, feels like we should have a special UX flow for this?
}
}
@@ -846,6 +847,11 @@ object BackupRepository {
Log.i(TAG, "Could not retrieve backup tier.", e)
null
}
if (SignalStore.backup.backupTier != null) {
SignalStore.uiHints.markHasEverEnabledRemoteBackups()
}
return SignalStore.backup.backupTier
}

View File

@@ -182,6 +182,7 @@ class MessageBackupsFlowViewModel : ViewModel() {
MessageBackupTier.FREE -> {
SignalStore.backup.areBackupsEnabled = true
SignalStore.backup.backupTier = MessageBackupTier.FREE
SignalStore.uiHints.markHasEverEnabledRemoteBackups()
state.copy(stage = MessageBackupsStage.COMPLETED)
}