From 8e46812a04ff3d9a424f2c2d24dee4ca04e506de Mon Sep 17 00:00:00 2001 From: Tobias Hagemann Date: Sat, 30 Nov 2024 15:44:40 +0100 Subject: [PATCH] Restrict product detail of lifetime license item to December 2024 sale promo --- Cryptomator/Purchase/PurchaseViewModel.swift | 6 +++++- CryptomatorTests/Purchase/PurchaseViewModelTests.swift | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cryptomator/Purchase/PurchaseViewModel.swift b/Cryptomator/Purchase/PurchaseViewModel.swift index a84692187..eddacd025 100644 --- a/Cryptomator/Purchase/PurchaseViewModel.swift +++ b/Cryptomator/Purchase/PurchaseViewModel.swift @@ -93,8 +93,12 @@ class PurchaseViewModel: BaseIAPViewModel, ProductFetching { private func addLifetimeLicenseItem() { if let product = products[.fullVersion], let localizedPrice = product.localizedPrice { + // Temporarily added for December 2024 Sale + let currentYear = Calendar.current.component(.year, from: Date()) + let currentMonth = Calendar.current.component(.month, from: Date()) + let productDetail = currentYear == 2024 && currentMonth == 12 ? "🎁 33%* off in December" : nil let viewModel = PurchaseCellViewModel(productName: LocalizedString.getValue("purchase.product.lifetimeLicense"), - productDetail: "🎁 33%* off in December", + productDetail: productDetail, price: localizedPrice, purchaseDetail: LocalizedString.getValue("purchase.product.lifetimeLicense.duration"), productIdentifier: .fullVersion) diff --git a/CryptomatorTests/Purchase/PurchaseViewModelTests.swift b/CryptomatorTests/Purchase/PurchaseViewModelTests.swift index d3e07bc8e..20a57547c 100644 --- a/CryptomatorTests/Purchase/PurchaseViewModelTests.swift +++ b/CryptomatorTests/Purchase/PurchaseViewModelTests.swift @@ -169,7 +169,7 @@ class PurchaseViewModelTests: IAPViewModelTestCase { private var lifetimeLicenseCell: Item { return .purchaseCell(.init(productName: LocalizedString.getValue("purchase.product.lifetimeLicense"), - productDetail: "🎁 33%* off in December", + productDetail: nil, price: "$11.99", purchaseDetail: LocalizedString.getValue("purchase.product.lifetimeLicense.duration"), productIdentifier: .fullVersion))