diff options
| author | Steffen Ernst <steffen.ernst@mullvad.net> | 2025-02-13 09:03:12 +0100 |
|---|---|---|
| committer | Steffen Ernst <steffen.ernst@mullvad.net> | 2025-02-17 09:40:34 +0100 |
| commit | 64dea3be74a7f256deca985f2df1a0c4ae43dcd1 (patch) | |
| tree | 6fadc0d6401bcd59884960d88dcd387236860e9d | |
| parent | 5dc09031dad361c916a0a392cff48a750671d069 (diff) | |
| download | mullvadvpn-64dea3be74a7f256deca985f2df1a0c4ae43dcd1.tar.xz mullvadvpn-64dea3be74a7f256deca985f2df1a0c4ae43dcd1.zip | |
Fix preconcurrency warning in purchase vc
| -rw-r--r-- | ios/MullvadVPN/View controllers/InAppPurchase/InAppPurchaseViewController.swift | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/ios/MullvadVPN/View controllers/InAppPurchase/InAppPurchaseViewController.swift b/ios/MullvadVPN/View controllers/InAppPurchase/InAppPurchaseViewController.swift index 8c5b9e2bc0..283073bf37 100644 --- a/ios/MullvadVPN/View controllers/InAppPurchase/InAppPurchaseViewController.swift +++ b/ios/MullvadVPN/View controllers/InAppPurchase/InAppPurchaseViewController.swift @@ -9,7 +9,7 @@ import StoreKit import UIKit -class InAppPurchaseViewController: UIViewController, @preconcurrency StorePaymentObserver { +class InAppPurchaseViewController: UIViewController, StorePaymentObserver { private let storePaymentManager: StorePaymentManager private let accountNumber: String private let paymentAction: PaymentAction @@ -140,22 +140,23 @@ class InAppPurchaseViewController: UIViewController, @preconcurrency StorePaymen present(sheetController, animated: true) } - @MainActor - func storePaymentManager(_ manager: StorePaymentManager, didReceiveEvent event: StorePaymentEvent) { - spinnerView.stopAnimating() - switch event { - case let .finished(completion): - errorPresenter.showAlertForResponse(completion.serverResponse, context: .purchase) { - self.didFinish?() - } + nonisolated func storePaymentManager(_ manager: StorePaymentManager, didReceiveEvent event: StorePaymentEvent) { + Task { @MainActor in + spinnerView.stopAnimating() + switch event { + case let .finished(completion): + errorPresenter.showAlertForResponse(completion.serverResponse, context: .purchase) { + self.didFinish?() + } - case let .failure(paymentFailure): - switch paymentFailure.error { - case .storePayment(SKError.paymentCancelled): - self.didFinish?() - default: - errorPresenter.showAlertForError(paymentFailure.error, context: .purchase) { + case let .failure(paymentFailure): + switch paymentFailure.error { + case .storePayment(SKError.paymentCancelled): self.didFinish?() + default: + errorPresenter.showAlertForError(paymentFailure.error, context: .purchase) { + self.didFinish?() + } } } } |
