diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2022-04-05 09:13:46 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2022-04-05 09:13:46 +0200 |
| commit | f758f894da5e368e54c83bd59013074192ce12be (patch) | |
| tree | 172961804441441ac6800d0c463b1e99feec5912 /ios/MullvadVPN/ProblemReportViewController.swift | |
| parent | 0f313bf16aae17e43981ad9716d9c73c780ea8db (diff) | |
| parent | 25ed6a8ea14ab9ef2442abb08d4ef2de0a5de8a9 (diff) | |
| download | mullvadvpn-f758f894da5e368e54c83bd59013074192ce12be.tar.xz mullvadvpn-f758f894da5e368e54c83bd59013074192ce12be.zip | |
Merge branch 'result-operation-subclass'
Diffstat (limited to 'ios/MullvadVPN/ProblemReportViewController.swift')
| -rw-r--r-- | ios/MullvadVPN/ProblemReportViewController.swift | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ios/MullvadVPN/ProblemReportViewController.swift b/ios/MullvadVPN/ProblemReportViewController.swift index e7370e76cf..b988d34cdb 100644 --- a/ios/MullvadVPN/ProblemReportViewController.swift +++ b/ios/MullvadVPN/ProblemReportViewController.swift @@ -568,8 +568,8 @@ class ProblemReportViewController: UIViewController, UITextFieldDelegate, Condit navigationItem.setHidesBackButton(true, animated: true) } - private func didSendProblemReport(viewModel: ViewModel, result: Result<(), REST.Error>) { - switch result { + private func didSendProblemReport(viewModel: ViewModel, completion: OperationCompletion<(), REST.Error>) { + switch completion { case .success: submissionOverlayView.state = .sent(viewModel.email) @@ -578,6 +578,9 @@ class ProblemReportViewController: UIViewController, UITextFieldDelegate, Condit case .failure(let error): submissionOverlayView.state = .failure(error) + + case .cancelled: + submissionOverlayView.state = .failure(.network(URLError(.cancelled))) } navigationItem.setHidesBackButton(false, animated: true) @@ -597,8 +600,8 @@ class ProblemReportViewController: UIViewController, UITextFieldDelegate, Condit willSendProblemReport() - _ = REST.Client.shared.sendProblemReport(request, retryStrategy: .default) { result in - self.didSendProblemReport(viewModel: viewModel, result: result) + _ = REST.Client.shared.sendProblemReport(request, retryStrategy: .default) { completion in + self.didSendProblemReport(viewModel: viewModel, completion: completion) } } |
