Add Out of Remote Storage sheet.

This commit is contained in:
Alex Hart
2025-08-06 12:54:03 -03:00
committed by Cody Henthorne
parent 50d809029e
commit 53a80589e3
10 changed files with 185 additions and 13 deletions

View File

@@ -76,7 +76,7 @@ class AppSettingsViewModel : ViewModel() {
private fun getBackupFailureState(): BackupFailureState {
return if (!RemoteConfig.messageBackups) {
BackupFailureState.NONE
} else if (BackupRepository.shouldDisplayOutOfStorageSpaceUx()) {
} else if (BackupRepository.shouldDisplayOutOfRemoteStorageSpaceUx()) {
BackupFailureState.OUT_OF_STORAGE_SPACE
} else if (BackupRepository.shouldDisplayBackupFailedSettingsRow()) {
BackupFailureState.BACKUP_FAILED

View File

@@ -270,7 +270,7 @@ class RemoteBackupsSettingsViewModel : ViewModel() {
}
private suspend fun performStateRefresh(lastPurchase: InAppPaymentTable.InAppPayment?) {
if (BackupRepository.shouldDisplayOutOfStorageSpaceUx()) {
if (BackupRepository.shouldDisplayOutOfRemoteStorageSpaceUx()) {
val paidType = BackupRepository.getPaidType()
if (paidType is NetworkResult.Success) {
@@ -278,7 +278,7 @@ class RemoteBackupsSettingsViewModel : ViewModel() {
val estimatedSize = SignalDatabase.attachments.getEstimatedArchiveMediaSize().bytes
if (estimatedSize + 300.mebiBytes <= remoteStorageAllowance) {
BackupRepository.clearOutOfRemoteStorageError()
BackupRepository.clearOutOfRemoteStorageSpaceError()
}
_state.update {
@@ -301,7 +301,7 @@ class RemoteBackupsSettingsViewModel : ViewModel() {
backupsFrequency = SignalStore.backup.backupFrequency,
canBackUpUsingCellular = SignalStore.backup.backupWithCellular,
canRestoreUsingCellular = SignalStore.backup.restoreWithCellular,
isOutOfStorageSpace = BackupRepository.shouldDisplayOutOfStorageSpaceUx(),
isOutOfStorageSpace = BackupRepository.shouldDisplayOutOfRemoteStorageSpaceUx(),
hasRedemptionError = lastPurchase?.data?.error?.data_ == "409"
)
}

View File

@@ -554,7 +554,7 @@ fun Screen(
Rows.TextRow(
text = "Mark out of remote storage space",
onClick = {
BackupRepository.markOutOfRemoteStorageError()
BackupRepository.markOutOfRemoteStorageSpaceError()
}
)