mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-02 08:23:00 +01:00
Show immediate progress feedback when creating a local backup.
Co-authored-by: Greyson Parrelli <greyson@signal.org>
This commit is contained in:
committed by
Greyson Parrelli
parent
db4c11cd53
commit
20d16a8433
@@ -98,6 +98,7 @@ class DefaultLocalBackupsSettingsCallback(
|
||||
override fun onCreateBackupClick() {
|
||||
if (BackupUtil.isUserSelectionRequired(fragment.requireContext())) {
|
||||
Log.i(TAG, "Queueing backup...")
|
||||
viewModel.onBackupStarted()
|
||||
enqueueArchive(false)
|
||||
} else {
|
||||
Permissions.with(fragment)
|
||||
@@ -105,6 +106,7 @@ class DefaultLocalBackupsSettingsCallback(
|
||||
.ifNecessary()
|
||||
.onAllGranted {
|
||||
Log.i(TAG, "Queuing backup...")
|
||||
viewModel.onBackupStarted()
|
||||
enqueueArchive(false)
|
||||
}
|
||||
.withPermanentDenialDialog(
|
||||
|
||||
@@ -116,6 +116,19 @@ class LocalBackupsViewModel : ViewModel(), BackupKeyCredentialManagerHandler {
|
||||
}
|
||||
}
|
||||
|
||||
fun onBackupStarted() {
|
||||
val context = AppDependencies.application
|
||||
internalSettingsState.update {
|
||||
it.copy(
|
||||
progress = BackupProgressState.InProgress(
|
||||
summary = context.getString(R.string.BackupsPreferenceFragment__in_progress),
|
||||
percentLabel = context.getString(R.string.BackupsPreferenceFragment__d_so_far, 0),
|
||||
progressFraction = null
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onBackupEvent(event: LocalBackupV2Event) {
|
||||
val context = AppDependencies.application
|
||||
|
||||
Reference in New Issue
Block a user