diff --git a/ios/MullvadVPN/Containers/Root/RootContainerViewController.swift b/ios/MullvadVPN/Containers/Root/RootContainerViewController.swift index 60f9faae6dd1..0d005d66b1cd 100644 --- a/ios/MullvadVPN/Containers/Root/RootContainerViewController.swift +++ b/ios/MullvadVPN/Containers/Root/RootContainerViewController.swift @@ -352,6 +352,11 @@ class RootContainerViewController: UIViewController { } } + func enableHeaderBarButtons(_ enabled: Bool) { + headerBarView.accountButton.isEnabled = enabled + headerBarView.settingsButton.isEnabled = enabled + } + // MARK: - Accessibility override func accessibilityPerformMagicTap() -> Bool { diff --git a/ios/MullvadVPN/Coordinators/WelcomeCoordinator.swift b/ios/MullvadVPN/Coordinators/WelcomeCoordinator.swift index ec6b9a30a850..512d31df00a7 100644 --- a/ios/MullvadVPN/Coordinators/WelcomeCoordinator.swift +++ b/ios/MullvadVPN/Coordinators/WelcomeCoordinator.swift @@ -122,6 +122,8 @@ extension WelcomeCoordinator: WelcomeViewControllerDelegate { } func didRequestToPurchaseCredit(controller: WelcomeViewController, accountNumber: String, product: SKProduct) { + navigationController.enableHeaderBarButtons(false) + let coordinator = InAppPurchaseCoordinator( navigationController: navigationController, interactor: inAppPurchaseInteractor @@ -131,11 +133,13 @@ extension WelcomeCoordinator: WelcomeViewControllerDelegate { coordinator.didFinish = { [weak self] coordinator in guard let self else { return } + navigationController.enableHeaderBarButtons(true) coordinator.removeFromParent() didFinish?() } - coordinator.didCancel = { coordinator in + coordinator.didCancel = { [weak self] coordinator in + self?.navigationController.enableHeaderBarButtons(true) coordinator.removeFromParent() } diff --git a/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift b/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift index de2ff4c77a82..7ee0326900df 100644 --- a/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift +++ b/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift @@ -178,6 +178,7 @@ final class WelcomeContentView: UIView { didSet { let alpha = isPurchasing ? 0.7 : 1.0 purchaseButton.isLoading = isPurchasing + purchaseButton.isEnabled = !isPurchasing purchaseButton.alpha = alpha redeemVoucherButton.isEnabled = !isPurchasing redeemVoucherButton.alpha = alpha