|
|
@@ -134,6 +134,7 @@ private final class PremiumPlansViewController: NSViewController {
|
|
|
private var planPriceFields: [String: (price: NSTextField, period: NSTextField)] = [:]
|
|
|
private var planPurchaseButtons: [String: NSButton] = [:]
|
|
|
private var subscriptionPrimaryFooterButton: NSButton?
|
|
|
+ private var premiumCloseButton: NSButton?
|
|
|
private var subscriptionStatusObservation: NSObjectProtocol?
|
|
|
|
|
|
private let plans: [Plan] = [
|
|
|
@@ -215,6 +216,7 @@ private final class PremiumPlansViewController: NSViewController {
|
|
|
await self?.subscriptionStore.loadProducts()
|
|
|
self?.applyStorePricing()
|
|
|
self?.updateSubscriptionPrimaryFooter()
|
|
|
+ self?.updatePremiumCloseButtonVisibility()
|
|
|
}
|
|
|
}
|
|
|
Task { await loadStoreProducts() }
|
|
|
@@ -303,6 +305,12 @@ private final class PremiumPlansViewController: NSViewController {
|
|
|
footerRow.widthAnchor.constraint(equalTo: root.widthAnchor),
|
|
|
crownIcon.heightAnchor.constraint(equalToConstant: 20)
|
|
|
])
|
|
|
+ premiumCloseButton = closeButton
|
|
|
+ updatePremiumCloseButtonVisibility()
|
|
|
+ }
|
|
|
+
|
|
|
+ private func updatePremiumCloseButtonVisibility() {
|
|
|
+ premiumCloseButton?.isHidden = !subscriptionStore.isProActive
|
|
|
}
|
|
|
|
|
|
private func makePricingCard(_ plan: Plan) -> NSView {
|