summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ios/CHANGELOG.md3
-rw-r--r--ios/MullvadVPN/Account.swift14
2 files changed, 11 insertions, 6 deletions
diff --git a/ios/CHANGELOG.md b/ios/CHANGELOG.md
index 36df73fa1b..e9a6f11048 100644
--- a/ios/CHANGELOG.md
+++ b/ios/CHANGELOG.md
@@ -26,6 +26,9 @@ Line wrap the file at 100 chars. Th
### Added
- Show privacy overlay when entering app switcher.
+### Fixed
+- Fix crash occurring after completing in-app purchase.
+
### Changed
- Increase hit area of settings (cog) button.
- Update launch screen.
diff --git a/ios/MullvadVPN/Account.swift b/ios/MullvadVPN/Account.swift
index 14a9e21326..716c6a35a5 100644
--- a/ios/MullvadVPN/Account.swift
+++ b/ios/MullvadVPN/Account.swift
@@ -245,13 +245,15 @@ extension Account: AppStorePaymentObserver {
func appStorePaymentManager(_ manager: AppStorePaymentManager, transaction: SKPaymentTransaction, accountToken: String, didFinishWithResponse response: REST.CreateApplePaymentResponse) {
dispatchQueue.async {
- let newExpiry = response.newExpiry
+ DispatchQueue.main.sync {
+ let newExpiry = response.newExpiry
- // Make sure that payment corresponds to the active account token
- if self.token == accountToken, self.expiry != newExpiry {
- self.expiry = newExpiry
- self.observerList.forEach { (observer) in
- observer.account(self, didUpdateExpiry: newExpiry)
+ // Make sure that payment corresponds to the active account token
+ if self.token == accountToken, self.expiry != newExpiry {
+ self.expiry = newExpiry
+ self.observerList.forEach { (observer) in
+ observer.account(self, didUpdateExpiry: newExpiry)
+ }
}
}
}