From 2c5d2ea179fc94df81c94a5d0fa5c228379d94d0 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 10 Jul 2020 17:34:09 +0200 Subject: [PATCH] Improve wording --- .../setup/KeysBackupSetupStep3Fragment.kt | 17 ++++++++--------- vector/src/main/res/values/strings.xml | 2 ++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/keysbackup/setup/KeysBackupSetupStep3Fragment.kt b/vector/src/main/java/im/vector/riotx/features/crypto/keysbackup/setup/KeysBackupSetupStep3Fragment.kt index de9c0add30..124bef2e28 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/keysbackup/setup/KeysBackupSetupStep3Fragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/keysbackup/setup/KeysBackupSetupStep3Fragment.kt @@ -176,25 +176,24 @@ class KeysBackupSetupStep3Fragment @Inject constructor() : VectorBaseFragment() os.write(data.toByteArray()) os.flush() } - }?.let { - uri.toString() } - ?: throw IOException() + ?: throw IOException("Unable to write the file") } .fold( { throwable -> - context?.let { + activity?.let { AlertDialog.Builder(it) .setTitle(R.string.dialog_title_error) - .setMessage(throwable.localizedMessage) + .setMessage(errorFormatter.toHumanReadable(throwable)) + } }, - { path -> + { viewModel.copyHasBeenMade = true - - context?.let { + activity?.let { AlertDialog.Builder(it) - .setMessage(getString(R.string.recovery_key_export_saved_as_warning, path)) + .setTitle(R.string.dialog_title_success) + .setMessage(R.string.recovery_key_export_saved) } } ) diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index a6868a1214..1bfff06005 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -126,6 +126,7 @@ Confirmation Warning Error + Success Home @@ -1413,6 +1414,7 @@ Why choose Riot.im? Share Save as File The recovery key has been saved to \'%s\'.\n\nWarning: this file may be deleted if the application is uninstalled. + The recovery key has been saved. A backup already exist on your HomeServer It looks like you already have setup key backup from another session. Do you want to replace it with the one you’re creating?