diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2022-03-28 14:56:06 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2022-04-05 09:12:56 +0200 |
| commit | eaeb54da9c31ae3de738980ec04a9f2b40204b21 (patch) | |
| tree | b78b88d4d4e302d629979dd013d8ba0d82e3d0a4 | |
| parent | f747a33fdc54c6ad288ab9392779faf22d11b4d1 (diff) | |
| download | mullvadvpn-eaeb54da9c31ae3de738980ec04a9f2b40204b21.tar.xz mullvadvpn-eaeb54da9c31ae3de738980ec04a9f2b40204b21.zip | |
SendAppStoreReceiptOperation: handle early cancellation
| -rw-r--r-- | ios/MullvadVPN/AppStorePaymentManager/AppStorePaymentManager.swift | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ios/MullvadVPN/AppStorePaymentManager/AppStorePaymentManager.swift b/ios/MullvadVPN/AppStorePaymentManager/AppStorePaymentManager.swift index 8c0567c777..9d4b56cf99 100644 --- a/ios/MullvadVPN/AppStorePaymentManager/AppStorePaymentManager.swift +++ b/ios/MullvadVPN/AppStorePaymentManager/AppStorePaymentManager.swift @@ -320,6 +320,11 @@ private class SendAppStoreReceiptOperation: AsyncOperation { override func main() { DispatchQueue.main.async { + guard !self.isCancelled else { + self.finish(completion: .cancelled) + return + } + self.fetchReceiptCancellable = AppStoreReceipt.fetch(forceRefresh: self.forceRefresh, receiptProperties: self.receiptProperties) { completion in switch completion { case .success(let receiptData): |
