IOS-1740 add saving verifiableAccount after verifying servers IOS-1740
authorAlejandro Gelos <agp@pep.security>
Mon, 19 Aug 2019 13:43:37 +0200
branchIOS-1740
changeset 972423a57a9beeb1
parent 9723 2da4ad6faab3
child 9725 efdbdfc23000
IOS-1740 add saving verifiableAccount after verifying servers
pEpForiOS/UI/Settings/Setting/AccountSettings/ViewModel/AccountSettingsViewModel.swift
     1.1 --- a/pEpForiOS/UI/Settings/Setting/AccountSettings/ViewModel/AccountSettingsViewModel.swift	Mon Aug 19 13:42:48 2019 +0200
     1.2 +++ b/pEpForiOS/UI/Settings/Setting/AccountSettings/ViewModel/AccountSettingsViewModel.swift	Mon Aug 19 13:43:37 2019 +0200
     1.3 @@ -217,7 +217,14 @@
     1.4      public func didEndVerification(result: Result<Void, Error>) {
     1.5          switch result {
     1.6          case .success(()):
     1.7 +            do {
     1.8 +                try verifiableAccount?.save { [weak self] _ in
     1.9 +                    self?.delegate?.didVerify(result: .ok)
    1.10 +                }
    1.11 +            } catch {
    1.12 +                Log.shared.errorAndCrash(error: error)
    1.13                  delegate?.didVerify(result: .ok)
    1.14 +            }
    1.15          case .failure(let error):
    1.16              if let imapError = error as? ImapSyncError {
    1.17                  delegate?.didVerify(