Add support for several BackupAlert sheet primary actions.

This commit is contained in:
Alex Hart 2024-07-26 16:21:40 -03:00 committed by Nicholas Tinsley
parent 1a7611d505
commit 1d0997379f
2 changed files with 10 additions and 7 deletions

View file

@ -38,8 +38,12 @@ import org.signal.core.ui.Icons
import org.signal.core.ui.Previews
import org.signal.core.ui.SignalPreview
import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity
import org.thoughtcrime.securesms.compose.ComposeBottomSheetDialogFragment
import org.thoughtcrime.securesms.database.model.databaseprotos.InAppPaymentData
import org.thoughtcrime.securesms.dependencies.AppDependencies
import org.thoughtcrime.securesms.jobs.BackupMessagesJob
import org.thoughtcrime.securesms.jobs.BackupRestoreMediaJob
/**
* Notifies the user of an issue with their backup.
@ -73,14 +77,13 @@ class BackupAlertBottomSheet : ComposeBottomSheetDialogFragment() {
private fun performPrimaryAction() {
when (backupAlert) {
BackupAlert.COULD_NOT_COMPLETE_BACKUP -> {
// TODO [message-backups] -- Back up now
BackupMessagesJob.enqueue()
startActivity(AppSettingsActivity.remoteBackups(requireContext()))
}
BackupAlert.PAYMENT_PROCESSING -> Unit
BackupAlert.MEDIA_BACKUPS_ARE_OFF -> {
// TODO [message-backups] -- Download media now
}
BackupAlert.MEDIA_WILL_BE_DELETED_TODAY -> {
// TODO [message-backups] -- Download media now
BackupAlert.MEDIA_BACKUPS_ARE_OFF, BackupAlert.MEDIA_WILL_BE_DELETED_TODAY -> {
// TODO [message-backups] -- We need to force this to download everything.
AppDependencies.jobManager.add(BackupRestoreMediaJob())
}
BackupAlert.DISK_FULL -> Unit
}

View file

@ -7,5 +7,5 @@ data class ChatsSettingsState(
val useSystemEmoji: Boolean,
val enterKeySends: Boolean,
val localBackupsEnabled: Boolean,
val canAccessRemoteBackupsSettings: Boolean,
val canAccessRemoteBackupsSettings: Boolean
)