|
@@ -1588,6 +1588,18 @@ import Combine
|
|
|
return true
|
|
|
}
|
|
|
|
|
|
+ private func _dmgCanPurchase(state: KMCompareTableType, tag: Int) -> Bool {
|
|
|
+ let isStandardAnnualSubscription = tag == 1
|
|
|
+ if state == .dmg_Base && isStandardAnnualSubscription && discountType == .advancedYearSubscribeTrialingCancel {
|
|
|
+ let member = KMMemberInfo.shared
|
|
|
+ if member.is_advanced_year_subscribe() && member.is_trailing() {
|
|
|
+ showAlert(message: NSLocalizedString("You are in a 7-day free trial. Please purchase the product after it expires.", comment: ""))
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
private func _appstorePurchaseGetProduct(state: KMCompareTableType, tag: Int, isPurchaseSwitch: Bool) -> IAPProduct? {
|
|
|
var product: IAPProduct?
|
|
|
if state == .lite_Base {
|
|
@@ -1814,10 +1826,15 @@ import Combine
|
|
|
return
|
|
|
}
|
|
|
// addWaitingView(to: window?.contentView ?? NSView())
|
|
|
-
|
|
|
+#if VERSION_DMG
|
|
|
+ if _dmgCanPurchase(state: model.state, tag: sender.tag) == false {
|
|
|
+ return
|
|
|
+ }
|
|
|
+#else
|
|
|
if _appstoreCanPurchase(product: product) == false {
|
|
|
return
|
|
|
}
|
|
|
+#endif
|
|
|
model.appstorePurchaseAction(sender.tag, discountType: discountType_) { [weak self] success, msg in
|
|
|
guard let self = self else { return }
|
|
|
}
|