|
|
@@ -356,11 +356,13 @@ private final class PremiumPlansViewController: NSViewController {
|
|
356
|
356
|
}
|
|
357
|
357
|
}
|
|
358
|
358
|
|
|
|
359
|
+ /// Shown until StoreKit returns localized `Product.displayPrice` (never use hardcoded currency amounts).
|
|
|
360
|
+ private static let unloadedPricePlaceholder = "—"
|
|
|
361
|
+
|
|
359
|
362
|
private struct Plan {
|
|
360
|
363
|
let id: String
|
|
361
|
364
|
let title: String
|
|
362
|
365
|
let subtitle: String
|
|
363
|
|
- let price: String
|
|
364
|
366
|
let period: String
|
|
365
|
367
|
let billedPill: String
|
|
366
|
368
|
let billedLine: String
|
|
|
@@ -405,7 +407,6 @@ private final class PremiumPlansViewController: NSViewController {
|
|
405
|
407
|
id: "weekly",
|
|
406
|
408
|
title: "Weekly",
|
|
407
|
409
|
subtitle: "Flexible and commitment-free",
|
|
408
|
|
- price: "$9.99",
|
|
409
|
410
|
period: "/ week",
|
|
410
|
411
|
billedPill: "",
|
|
411
|
412
|
billedLine: "",
|
|
|
@@ -424,7 +425,6 @@ private final class PremiumPlansViewController: NSViewController {
|
|
424
|
425
|
id: "monthly",
|
|
425
|
426
|
title: "Monthly",
|
|
426
|
427
|
subtitle: "Balanced for regular productivity",
|
|
427
|
|
- price: "$19.99",
|
|
428
|
428
|
period: "/ month",
|
|
429
|
429
|
billedPill: "",
|
|
430
|
430
|
billedLine: "",
|
|
|
@@ -443,7 +443,6 @@ private final class PremiumPlansViewController: NSViewController {
|
|
443
|
443
|
id: "yearly",
|
|
444
|
444
|
title: "Yearly",
|
|
445
|
445
|
subtitle: "Best value for long-term users",
|
|
446
|
|
- price: "$39.99",
|
|
447
|
446
|
period: "/ year",
|
|
448
|
447
|
billedPill: "3 days free trial",
|
|
449
|
448
|
billedLine: "",
|
|
|
@@ -603,7 +602,7 @@ private final class PremiumPlansViewController: NSViewController {
|
|
603
|
602
|
topRightTag.isHidden = plan.billedPill.isEmpty
|
|
604
|
603
|
topRightTag.font = .systemFont(ofSize: 10, weight: .bold)
|
|
605
|
604
|
|
|
606
|
|
- let priceLabel = NSTextField(labelWithString: plan.price)
|
|
|
605
|
+ let priceLabel = NSTextField(labelWithString: Self.unloadedPricePlaceholder)
|
|
607
|
606
|
priceLabel.font = .systemFont(ofSize: 18, weight: .semibold)
|
|
608
|
607
|
priceLabel.textColor = Theme.primaryText
|
|
609
|
608
|
|
|
|
@@ -931,8 +930,11 @@ private final class PremiumPlansViewController: NSViewController {
|
|
931
|
930
|
|
|
932
|
931
|
private func applyStorePricing() {
|
|
933
|
932
|
for plan in plans {
|
|
934
|
|
- guard let fields = planPriceFields[plan.id],
|
|
935
|
|
- let product = subscriptionStore.product(forPlanKey: plan.id) else { continue }
|
|
|
933
|
+ guard let fields = planPriceFields[plan.id] else { continue }
|
|
|
934
|
+ guard let product = subscriptionStore.product(forPlanKey: plan.id) else {
|
|
|
935
|
+ fields.price.stringValue = Self.unloadedPricePlaceholder
|
|
|
936
|
+ continue
|
|
|
937
|
+ }
|
|
936
|
938
|
fields.price.stringValue = product.displayPrice
|
|
937
|
939
|
if let period = product.subscription?.subscriptionPeriod {
|
|
938
|
940
|
fields.period.stringValue = periodSuffix(for: period)
|