|
|
@@ -353,7 +353,18 @@ struct PremiumFeaturesView: View {
|
|
|
|
|
|
private var compactFooterLinks: some View {
|
|
|
VStack(spacing: 10) {
|
|
|
- continueWithFreeButton
|
|
|
+ if premiumStore.isPremiumUnlocked {
|
|
|
+ HStack {
|
|
|
+ footerActionButton("Manage Subscription") { openManageSubscriptions() }
|
|
|
+ Spacer()
|
|
|
+ footerActionButton(premiumStore.restoreInProgress ? "Restoring…" : "Restore Purchase") {
|
|
|
+ Task { await premiumStore.restorePurchases() }
|
|
|
+ }
|
|
|
+ .disabled(premiumStore.restoreInProgress || premiumStore.purchaseInProgress)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ continueWithFreeButton
|
|
|
+ }
|
|
|
|
|
|
HStack {
|
|
|
Spacer()
|
|
|
@@ -376,8 +387,18 @@ struct PremiumFeaturesView: View {
|
|
|
.padding(.top, 6)
|
|
|
|
|
|
HStack {
|
|
|
- footerActionButton("Continue with Free") { dismissPremiumUI() }
|
|
|
- Spacer(minLength: 18)
|
|
|
+ if premiumStore.isPremiumUnlocked {
|
|
|
+ footerActionButton("Manage Subscription") { openManageSubscriptions() }
|
|
|
+ Spacer(minLength: 18)
|
|
|
+ footerActionButton(premiumStore.restoreInProgress ? "Restoring…" : "Restore Purchase") {
|
|
|
+ Task { await premiumStore.restorePurchases() }
|
|
|
+ }
|
|
|
+ .disabled(premiumStore.restoreInProgress || premiumStore.purchaseInProgress)
|
|
|
+ Spacer(minLength: 18)
|
|
|
+ } else {
|
|
|
+ footerActionButton("Continue with Free") { dismissPremiumUI() }
|
|
|
+ Spacer(minLength: 18)
|
|
|
+ }
|
|
|
footerActionButton("Privacy Policy") { openExternalPage(ExternalPage.privacy) }
|
|
|
Spacer(minLength: 18)
|
|
|
footerActionButton("Support") { openExternalPage(ExternalPage.support) }
|
|
|
@@ -389,6 +410,15 @@ struct PremiumFeaturesView: View {
|
|
|
.padding(.top, 8)
|
|
|
}
|
|
|
|
|
|
+ private func openManageSubscriptions() {
|
|
|
+ let appStoreURL = URL(string: "macappstore://apps.apple.com/account/subscriptions")!
|
|
|
+ if NSWorkspace.shared.open(appStoreURL) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let webURL = URL(string: "https://apps.apple.com/account/subscriptions")!
|
|
|
+ _ = NSWorkspace.shared.open(webURL)
|
|
|
+ }
|
|
|
+
|
|
|
private var continueWithFreeButton: some View {
|
|
|
Button("Continue with Free") {
|
|
|
dismissPremiumUI()
|