diff --git a/Session/Onboarding/LoadAccountScreen.swift b/Session/Onboarding/LoadAccountScreen.swift index d696e017d..fe971035f 100644 --- a/Session/Onboarding/LoadAccountScreen.swift +++ b/Session/Onboarding/LoadAccountScreen.swift @@ -85,7 +85,14 @@ struct LoadAccountScreen: View { hexEncodedSeed = try Mnemonic.decode(mnemonic: mnemonic) } catch { if let decodingError = error as? Mnemonic.DecodingError { - errorString = decodingError.errorDescription + switch decodingError { + case .inputTooShort, .missingLastWord: + errorString = "recoveryPasswordErrorMessageShort".localized() + case .invalidWord, .verificationFailed: + errorString = "recoveryPasswordErrorMessageIncorrect".localized() + default: + errorString = "recoveryPasswordErrorMessageGeneric".localized() + } } else { errorString = "recoveryPasswordErrorMessageGeneric".localized() } diff --git a/SessionUtilitiesKit/Crypto/Mnemonic.swift b/SessionUtilitiesKit/Crypto/Mnemonic.swift index 53bc31069..93260931a 100644 --- a/SessionUtilitiesKit/Crypto/Mnemonic.swift +++ b/SessionUtilitiesKit/Crypto/Mnemonic.swift @@ -67,17 +67,6 @@ public enum Mnemonic { public enum DecodingError : LocalizedError { case generic, inputTooShort, missingLastWord, invalidWord, verificationFailed - - public var errorDescription: String { - switch self { - case .inputTooShort: - return "recoveryPasswordErrorMessageShort".localized() - case .invalidWord: - return "recoveryPasswordErrorMessageIncorrect".localized() - default: - return "recoveryPasswordErrorMessageGeneric".localized() - } - } } public static func hash(hexEncodedString string: String, language: Language = .english) -> String {