Skip to content

Commit cf0dfdc

Browse files
alex-signalcody-signal
authored andcommitted
Display resume over cellular only if awaiting wifi.
1 parent 26b6019 commit cf0dfdc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/src/main/java/org/thoughtcrime/securesms/components/settings/app/backups/remote/RemoteBackupsSettingsFragment.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,14 +656,19 @@ private fun LazyListScope.appendRestoreFromBackupStatusData(
656656
item {
657657
BackupStatusRow(
658658
backupStatusData = backupRestoreState.backupStatusData,
659-
restoreType = RestoreType.DOWNLOAD,
659+
restoreType = if (isCancelable) RestoreType.DOWNLOAD else RestoreType.RESTORE,
660660
onCancelClick = if (isCancelable) contentCallbacks::onCancelMediaRestore else null,
661661
onSkipClick = contentCallbacks::onDisplaySkipMediaRestoreProtectionDialog,
662662
onLearnMoreClick = contentCallbacks::onLearnMoreAboutBackupFailure
663663
)
664664
}
665665

666-
if (!canRestoreUsingCellular) {
666+
val displayResumeButton = when (val data = backupRestoreState.backupStatusData) {
667+
is BackupStatusData.RestoringMedia -> !canRestoreUsingCellular && data.restoreStatus == BackupStatusData.RestoreStatus.WAITING_FOR_WIFI
668+
else -> false
669+
}
670+
671+
if (displayResumeButton) {
667672
item {
668673
Rows.TextRow(
669674
text = stringResource(R.string.RemoteBackupsSettingsFragment__resume_download),

0 commit comments

Comments
 (0)