diff options
| author | Bug Magnet <marco.nikic@mullvad.net> | 2024-12-04 14:43:23 +0100 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2025-01-14 10:18:06 +0100 |
| commit | d1cf679456f87b2f93b150c67a76fa20e31d7643 (patch) | |
| tree | 6ae6911848db62013e09939488a54fd98bad81b4 /ios/MullvadVPN/View controllers/ProblemReport | |
| parent | d2949b4a0b1d3d86a25de1569dc8308c9d7fe237 (diff) | |
| download | mullvadvpn-d1cf679456f87b2f93b150c67a76fa20e31d7643.tar.xz mullvadvpn-d1cf679456f87b2f93b150c67a76fa20e31d7643.zip | |
Enable compilation with Swift 6 for most targets
Diffstat (limited to 'ios/MullvadVPN/View controllers/ProblemReport')
3 files changed, 20 insertions, 14 deletions
diff --git a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportInteractor.swift b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportInteractor.swift index 616ea7d081..a63d97e2ed 100644 --- a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportInteractor.swift +++ b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportInteractor.swift @@ -11,7 +11,7 @@ import MullvadREST import MullvadTypes import Operations -final class ProblemReportInteractor { +final class ProblemReportInteractor: @unchecked Sendable { private let apiProxy: APIQuerying private let tunnelManager: TunnelManager private let consolidatedLog: ConsolidatedApplicationLog @@ -28,7 +28,7 @@ final class ProblemReportInteractor { ) } - func fetchReportString(completion: @escaping (String) -> Void) { + func fetchReportString(completion: @escaping @Sendable (String) -> Void) { consolidatedLog.addLogFiles(fileURLs: ApplicationTarget.allCases.flatMap { ApplicationConfiguration.logFileURLs(for: $0, in: ApplicationConfiguration.containerURL) }) { [weak self] in @@ -40,7 +40,7 @@ final class ProblemReportInteractor { func sendReport( email: String, message: String, - completion: @escaping (Result<Void, Error>) -> Void + completion: @escaping @Sendable (Result<Void, Error>) -> Void ) { let logString = self.consolidatedLog.string @@ -67,7 +67,7 @@ final class ProblemReportInteractor { email: String, message: String, logString: String, - completion: @escaping (Result<Void, Error>) -> Void + completion: @escaping @Sendable (Result<Void, Error>) -> Void ) { let metadataDict = self.consolidatedLog.metadata.reduce(into: [:]) { output, entry in output[entry.key.rawValue] = entry.value diff --git a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift index 56befb66fd..1103a76e71 100644 --- a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift +++ b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift @@ -97,9 +97,11 @@ class ProblemReportReviewViewController: UIViewController { spinnerView.startAnimating() interactor.fetchReportString { [weak self] reportString in guard let self else { return } - textView.text = reportString - spinnerView.stopAnimating() - spinnerContainerView.isHidden = true + Task { @MainActor in + textView.text = reportString + spinnerView.stopAnimating() + spinnerContainerView.isHidden = true + } } } @@ -107,14 +109,16 @@ class ProblemReportReviewViewController: UIViewController { private func share() { interactor.fetchReportString { [weak self] reportString in guard let self,!reportString.isEmpty else { return } - let activityController = UIActivityViewController( - activityItems: [reportString], - applicationActivities: nil - ) + Task { @MainActor in + let activityController = UIActivityViewController( + activityItems: [reportString], + applicationActivities: nil + ) - activityController.popoverPresentationController?.barButtonItem = navigationItem.leftBarButtonItem + activityController.popoverPresentationController?.barButtonItem = navigationItem.leftBarButtonItem - present(activityController, animated: true) + present(activityController, animated: true) + } } } #endif diff --git a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift index 1cbba022e4..a7ad2d73a7 100644 --- a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift +++ b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift @@ -262,7 +262,9 @@ final class ProblemReportViewController: UIViewController, UITextFieldDelegate { email: viewModel.email, message: viewModel.message ) { completion in - self.didSendProblemReport(viewModel: viewModel, completion: completion) + Task { @MainActor in + self.didSendProblemReport(viewModel: viewModel, completion: completion) + } } } |
