Add support for several BackupAlert sheet primary actions.
This commit is contained in:
parent
1a7611d505
commit
1d0997379f
2 changed files with 10 additions and 7 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -7,5 +7,5 @@ data class ChatsSettingsState(
|
|||
val useSystemEmoji: Boolean,
|
||||
val enterKeySends: Boolean,
|
||||
val localBackupsEnabled: Boolean,
|
||||
val canAccessRemoteBackupsSettings: Boolean,
|
||||
val canAccessRemoteBackupsSettings: Boolean
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue