Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Improve UX when restoring e2e keys (#2999)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed Feb 25, 2019
1 parent 54e9154 commit b0984c3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Features:
-

Improvements:
-
- Improve UX when restoring e2e keys (#2999)

Other changes:
-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,18 @@ class KeysBackupRestoreFromKeyViewModel : ViewModel() {
isIndeterminate = true)
}
is StepProgressListener.Step.ImportingKey -> {
sharedViewModel.loadingEvent.value = WaitingViewData(context.getString(R.string.keys_backup_restoring_waiting_message)
+ "\n" + context.getString(R.string.keys_backup_restoring_importing_keys_waiting_message),
step.progress,
step.total)
// Progress 0 can take a while, display an indeterminate progress in this case
if (step.progress == 0) {
sharedViewModel.loadingEvent.value = WaitingViewData(context.getString(R.string.keys_backup_restoring_waiting_message)
+ "\n" + context.getString(R.string.keys_backup_restoring_importing_keys_waiting_message),
isIndeterminate = true)

} else {
sharedViewModel.loadingEvent.value = WaitingViewData(context.getString(R.string.keys_backup_restoring_waiting_message)
+ "\n" + context.getString(R.string.keys_backup_restoring_importing_keys_waiting_message),
step.progress,
step.total)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,18 @@ class KeysBackupRestoreFromPassphraseViewModel : ViewModel() {
isIndeterminate = true)
}
is StepProgressListener.Step.ImportingKey -> {
sharedViewModel.loadingEvent.value = WaitingViewData(context.getString(R.string.keys_backup_restoring_waiting_message)
+ "\n" + context.getString(R.string.keys_backup_restoring_importing_keys_waiting_message),
step.progress,
step.total)
// Progress 0 can take a while, display an indeterminate progress in this case
if (step.progress == 0) {
sharedViewModel.loadingEvent.value = WaitingViewData(context.getString(R.string.keys_backup_restoring_waiting_message)
+ "\n" + context.getString(R.string.keys_backup_restoring_importing_keys_waiting_message),
isIndeterminate = true)

} else {
sharedViewModel.loadingEvent.value = WaitingViewData(context.getString(R.string.keys_backup_restoring_waiting_message)
+ "\n" + context.getString(R.string.keys_backup_restoring_importing_keys_waiting_message),
step.progress,
step.total)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion vector/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ Why choose Riot.im?
<string name="keys_backup_passphrase_error_decrypt">Backup could not be decrypted with this passphrase: please verify that you entered the correct recovery passphrase.</string>
<string name="network_error_please_check_and_retry">Network error: please check your connection and retry.</string>

<string name="keys_backup_restoring_waiting_message">Restoring backup</string>
<string name="keys_backup_restoring_waiting_message">Restoring backup:</string>
<string name="keys_backup_restoring_computing_key_waiting_message">Computing recovery key…</string>
<string name="keys_backup_restoring_downloading_backup_waiting_message">Downloading keys…</string>
<string name="keys_backup_restoring_importing_keys_waiting_message">Importing keys…</string>
Expand Down

0 comments on commit b0984c3

Please sign in to comment.