Fixed error handling after merge

pull/891/head
Morgan Pretty 11 months ago
parent e420ce4e58
commit 73193df2e1

@ -94,18 +94,13 @@ struct NewMessageScreen: View {
case .finished: break
case .failure(let error):
modalActivityIndicator.dismiss {
var messageOrNil: String?
if let error = error as? SnodeAPIError {
let message: String = {
switch error {
case .generic, .decryptionFailed, .hashingFailed, .validationFailed:
messageOrNil = "onsErrorUnableToSearch".localized()
case SnodeAPIError.onsDecryptionFailed, SnodeAPIError.onsHashingFailed,
SnodeAPIError.onsValidationFailed:
return "onsErrorUnableToSearch".localized()
default: break
}
}
let message: String = {
if let messageOrNil: String = messageOrNil {
return messageOrNil
}
return (maybeSessionId?.prefix == .blinded15 || maybeSessionId?.prefix == .blinded25 ?
"accountIdErrorInvalid".localized() :

Loading…
Cancel
Save