|
|
@@ -470,7 +470,7 @@ private extension ViewController {
|
|
|
|
|
|
@objc private func premiumButtonClicked(_ sender: NSClickGestureRecognizer) {
|
|
|
if storeKitCoordinator.hasPremiumAccess {
|
|
|
- openManageSubscriptions()
|
|
|
+ showPaywall(upgradeFlow: true, preferredPlan: .lifetime)
|
|
|
} else {
|
|
|
showPaywall()
|
|
|
}
|
|
|
@@ -800,6 +800,15 @@ private extension ViewController {
|
|
|
alert.runModal()
|
|
|
}
|
|
|
|
|
|
+ private func confirmPremiumUpgrade() -> Bool {
|
|
|
+ let alert = NSAlert()
|
|
|
+ alert.messageText = "Already Premium"
|
|
|
+ alert.informativeText = "You are already premium. Do you want to continue with this purchase?"
|
|
|
+ alert.addButton(withTitle: "Continue")
|
|
|
+ alert.addButton(withTitle: "Cancel")
|
|
|
+ return alert.runModal() == .alertFirstButtonReturn
|
|
|
+ }
|
|
|
+
|
|
|
private func showPaywall(upgradeFlow: Bool = false, preferredPlan: PremiumPlan? = nil) {
|
|
|
paywallUpgradeFlowEnabled = upgradeFlow
|
|
|
if let preferredPlan {
|
|
|
@@ -1094,6 +1103,9 @@ private extension ViewController {
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+ if paywallUpgradeFlowEnabled && storeKitCoordinator.hasPremiumAccess && !confirmPremiumUpgrade() {
|
|
|
+ return
|
|
|
+ }
|
|
|
paywallPurchaseTask?.cancel()
|
|
|
updatePaywallContinueState(isLoading: true)
|
|
|
let selectedPlan = selectedPremiumPlan
|
|
|
@@ -1132,15 +1144,9 @@ private extension ViewController {
|
|
|
paywallContinueLabel?.stringValue = "Premium Active"
|
|
|
paywallContinueButton?.alphaValue = 0.75
|
|
|
} else if paywallUpgradeFlowEnabled && storeKitCoordinator.hasPremiumAccess {
|
|
|
- if selectedPremiumPlan == .lifetime {
|
|
|
- paywallContinueEnabled = true
|
|
|
- paywallContinueLabel?.stringValue = "Continue"
|
|
|
- paywallContinueButton?.alphaValue = 1.0
|
|
|
- } else {
|
|
|
- paywallContinueEnabled = false
|
|
|
- paywallContinueLabel?.stringValue = "Select Lifetime to Upgrade"
|
|
|
- paywallContinueButton?.alphaValue = 0.75
|
|
|
- }
|
|
|
+ paywallContinueEnabled = true
|
|
|
+ paywallContinueLabel?.stringValue = "Continue"
|
|
|
+ paywallContinueButton?.alphaValue = 1.0
|
|
|
} else {
|
|
|
paywallContinueEnabled = true
|
|
|
paywallContinueLabel?.stringValue = "Continue"
|