Browse Source

Replace paywall restore CTA with legal/support placeholders.

Adds Privacy Policy, Support, and Terms of Services footer actions with publish-time placeholder alerts, and adapts their text color for dark/light mode readability.

Made-with: Cursor
huzaifahayat12 3 tháng trước cách đây
mục cha
commit
df3ac77175
1 tập tin đã thay đổi với 55 bổ sung24 xóa
  1. 55 24
      zoom_app/ViewController.swift

+ 55 - 24
zoom_app/ViewController.swift

@@ -283,7 +283,6 @@ class ViewController: NSViewController {
     private weak var paywallContinueLabel: NSTextField?
     private weak var paywallContinueButton: NSView?
     private var paywallPurchaseTask: Task<Void, Never>?
-    private var paywallRestoreTask: Task<Void, Never>?
     private var paywallContinueEnabled = true
     private var lastKnownPremiumAccess = false
     private var allScheduledMeetings: [ScheduledMeeting] = []
@@ -3572,16 +3571,30 @@ class ViewController: NSViewController {
         contentStack.addArrangedSubview(secureWrap)
         contentStack.setCustomSpacing(8, after: secureWrap)
 
-        let restoreButton = NSButton(title: "Restore Purchases", target: self, action: #selector(paywallRestorePurchasesClicked(_:)))
-        restoreButton.translatesAutoresizingMaskIntoConstraints = false
-        restoreButton.isBordered = false
-        restoreButton.bezelStyle = .shadowlessSquare
-        restoreButton.font = NSFont.systemFont(ofSize: 12, weight: .semibold)
-        restoreButton.contentTintColor = accentBlue
-        restoreButton.alignment = .center
-        restoreButton.heightAnchor.constraint(equalToConstant: 24).isActive = true
-        restoreButton.widthAnchor.constraint(greaterThanOrEqualToConstant: paywallContentWidth).isActive = true
-        contentStack.addArrangedSubview(restoreButton)
+        let footerButtons = NSStackView()
+        footerButtons.translatesAutoresizingMaskIntoConstraints = false
+        footerButtons.orientation = .horizontal
+        footerButtons.alignment = .centerY
+        footerButtons.distribution = .fillEqually
+        footerButtons.spacing = 8
+        footerButtons.widthAnchor.constraint(greaterThanOrEqualToConstant: paywallContentWidth).isActive = true
+
+        let privacyButton = paywallFooterButton(
+            title: "Privacy Policy",
+            action: #selector(paywallPrivacyPolicyClicked(_:))
+        )
+        let supportButton = paywallFooterButton(
+            title: "Support",
+            action: #selector(paywallSupportClicked(_:))
+        )
+        let termsButton = paywallFooterButton(
+            title: "Terms of Services",
+            action: #selector(paywallTermsOfServicesClicked(_:))
+        )
+        footerButtons.addArrangedSubview(privacyButton)
+        footerButtons.addArrangedSubview(supportButton)
+        footerButtons.addArrangedSubview(termsButton)
+        contentStack.addArrangedSubview(footerButtons)
 
         NSLayoutConstraint.activate([
             contentStack.leadingAnchor.constraint(equalTo: panel.leadingAnchor, constant: 18),
@@ -3817,19 +3830,37 @@ class ViewController: NSViewController {
         startSelectedPlanPurchase()
     }
 
-    @objc private func paywallRestorePurchasesClicked(_ sender: Any?) {
-        paywallRestoreTask?.cancel()
-        updatePaywallContinueState(isLoading: true)
-        paywallRestoreTask = Task { [weak self] in
-            guard let self else { return }
-            let restoreResult = await self.storeKitCoordinator.restorePurchases()
-            await MainActor.run {
-                self.updatePaywallContinueState(isLoading: false)
-                self.refreshPaywallStoreUI()
-                self.updatePremiumButtons()
-                self.showSimpleAlert(title: "Restore Purchases", message: restoreResult)
-            }
-        }
+    private func paywallFooterButton(title: String, action: Selector) -> NSButton {
+        let button = NSButton(title: title, target: self, action: action)
+        button.translatesAutoresizingMaskIntoConstraints = false
+        button.isBordered = false
+        button.bezelStyle = .shadowlessSquare
+        button.font = NSFont.systemFont(ofSize: 12, weight: .semibold)
+        button.contentTintColor = palette.isDarkMode ? .white : .black
+        button.alignment = .center
+        button.heightAnchor.constraint(equalToConstant: 24).isActive = true
+        return button
+    }
+
+    @objc private func paywallPrivacyPolicyClicked(_ sender: Any?) {
+        showSimpleAlert(
+            title: "Privacy Policy",
+            message: "Placeholder: Privacy Policy content/link will be added before publishing."
+        )
+    }
+
+    @objc private func paywallSupportClicked(_ sender: Any?) {
+        showSimpleAlert(
+            title: "Support",
+            message: "Placeholder: Support contact details/link will be added before publishing."
+        )
+    }
+
+    @objc private func paywallTermsOfServicesClicked(_ sender: Any?) {
+        showSimpleAlert(
+            title: "Terms of Services",
+            message: "Placeholder: Terms of Services content/link will be added before publishing."
+        )
     }
 
     private func startSelectedPlanPurchase() {