This commit is contained in:
Benoit Marty 2020-05-04 17:30:55 +02:00
parent dc7b3dfc9d
commit d679c9d5d8

View File

@ -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)
}