From d679c9d5d809596f43d3a3e69ffe455864970e40 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 4 May 2020 17:30:55 +0200 Subject: [PATCH] Cleanup --- .../restore/KeysBackupRestoreFromPassphraseFragment.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/keysbackup/restore/KeysBackupRestoreFromPassphraseFragment.kt b/vector/src/main/java/im/vector/riotx/features/crypto/keysbackup/restore/KeysBackupRestoreFromPassphraseFragment.kt index 0947c144d8..6f91496f42 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/keysbackup/restore/KeysBackupRestoreFromPassphraseFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/keysbackup/restore/KeysBackupRestoreFromPassphraseFragment.kt @@ -70,7 +70,7 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBase mPassphraseInputLayout.error = newValue }) - helperTextWithLink.text = spannableStringForHelperText(context!!) + helperTextWithLink.text = spannableStringForHelperText() viewModel.showPasswordMode.observe(viewLifecycleOwner, Observer { val shouldBeVisible = it ?: false @@ -87,9 +87,9 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBase } } - private fun spannableStringForHelperText(context: Context): SpannableString { - val clickableText = context.getString(R.string.keys_backup_restore_use_recovery_key) - val helperText = context.getString(R.string.keys_backup_restore_with_passphrase_helper_with_link, clickableText) + private fun spannableStringForHelperText(): SpannableString { + val clickableText = getString(R.string.keys_backup_restore_use_recovery_key) + val helperText = getString(R.string.keys_backup_restore_with_passphrase_helper_with_link, clickableText) val spanString = SpannableString(helperText) @@ -117,7 +117,7 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor() : VectorBase fun onRestoreBackup() { val value = viewModel.passphrase.value if (value.isNullOrBlank()) { - viewModel.passphraseErrorText.value = context?.getString(R.string.passphrase_empty_error_message) + viewModel.passphraseErrorText.value = getString(R.string.passphrase_empty_error_message) } else { viewModel.recoverKeys(sharedViewModel) }