mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Add Out of Remote Storage sheet.
This commit is contained in:
committed by
Cody Henthorne
parent
50d809029e
commit
53a80589e3
@@ -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
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -554,7 +554,7 @@ fun Screen(
|
||||
Rows.TextRow(
|
||||
text = "Mark out of remote storage space",
|
||||
onClick = {
|
||||
BackupRepository.markOutOfRemoteStorageError()
|
||||
BackupRepository.markOutOfRemoteStorageSpaceError()
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user