mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 09:02:44 +02:00
Secrets recovery: Handle MXRecoveryService errors in recovery view models.
This commit is contained in:
+6
-3
@@ -177,9 +177,12 @@ final class SecretsRecoveryWithKeyViewController: UIViewController {
|
||||
private func render(error: Error) {
|
||||
self.activityPresenter.removeCurrentActivityIndicator(animated: true)
|
||||
|
||||
// TODO: Use appropriate error codes
|
||||
if (error as NSError).domain == MXSecretStorageErrorDomain
|
||||
&& (error as NSError).code == Int(MXSecretStorageErrorCode.badMacCode.rawValue) {
|
||||
let nsError = error as NSError
|
||||
|
||||
if nsError.domain == MXRecoveryServiceErrorDomain
|
||||
&& (nsError.code == Int(MXRecoveryServiceErrorCode.badRecoveryKeyErrorCode.rawValue)
|
||||
|| nsError.code == Int(MXRecoveryServiceErrorCode.badRecoveryKeyFormatErrorCode.rawValue)
|
||||
) {
|
||||
|
||||
self.errorPresenter.presentError(from: self,
|
||||
title: VectorL10n.secretsRecoveryWithKeyInvalidRecoveryKeyTitle,
|
||||
|
||||
Reference in New Issue
Block a user