From 423df70351daa5b1615a31123fc3c1dc4f59dbfa Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 25 Jun 2024 14:31:05 +0930 Subject: [PATCH] SES-2201 Fix error on 1 word missing --- .../securesms/onboarding/loadaccount/LoadAccountViewModel.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/onboarding/loadaccount/LoadAccountViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/onboarding/loadaccount/LoadAccountViewModel.kt index 17ed0066c1..a9029c4c02 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/onboarding/loadaccount/LoadAccountViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/onboarding/loadaccount/LoadAccountViewModel.kt @@ -15,6 +15,7 @@ import network.loki.messenger.R import org.session.libsignal.crypto.MnemonicCodec import org.session.libsignal.crypto.MnemonicCodec.DecodingError.InputTooShort import org.session.libsignal.crypto.MnemonicCodec.DecodingError.InvalidWord +import org.session.libsignal.crypto.MnemonicCodec.DecodingError.MissingLastWord import org.session.libsignal.utilities.Hex import org.thoughtcrime.securesms.crypto.MnemonicUtilities import javax.inject.Inject @@ -69,7 +70,8 @@ internal class LinkDeviceViewModel @Inject constructor( state.update { it.copy( error = when (error) { - is InputTooShort -> R.string.recoveryPasswordErrorMessageShort + is InputTooShort, + is MissingLastWord -> R.string.recoveryPasswordErrorMessageShort is InvalidWord -> R.string.recoveryPasswordErrorMessageIncorrect else -> R.string.recoveryPasswordErrorMessageGeneric }.let(application::getString)