Bläddra i källkod

Merge branch 'develop_PDFReaderProNew' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProNew

tangchao 6 dagar sedan
förälder
incheckning
41305f5266

+ 57 - 48
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.swift

@@ -281,21 +281,49 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
     func updateProduct_Info() -> Void { //重新获取产品接口
         if KMMemberInfo.shared.isLogin {
             let model = KMProductModel.shared
-            model.getDMGProductPriceInfosForMember(productId: product_Info.id, isEducation: 0) { [weak self] success, result in
-                if success {
-                    guard let productResults : KMMemberProductResult = result else {
+            if(pdfCount > 1) {
+                model.getDMGBatchProductPriceInfosForMember(productId: _product_Info.id, num: pdfCount) { [weak self] success, result in
+                    guard let pricesArrays : KMMemberProductResult = result else {
                         return
                     }
-                    guard let products : [KMListingProductsModel] = productResults.listingProducts else {
+                    guard let batchProductPrice : KMBatchProductPriceModel = pricesArrays.batchProductPrice else {
                         return
                     }
-                    guard let product : KMListingProductsModel = products.first else {
-                        return
+                    //原价更新
+                    let priceString = batchProductPrice.totalPrice
+                    self?.product_Info.priceString = priceString
+                    
+                    let cnyPriceString = batchProductPrice.cnyTotalPrice
+                    self?.product_Info.cnyPriceString = cnyPriceString //批量时将总价赋给priceString,只显示priceString价格了,其他的置空
+                    
+                    self?.product_Info.upgradePriceString = nil
+                    self?.product_Info.displayPriceString = nil
+                    self?.product_Info.displayCnyPriceString = nil
+                    self?.product_Info.individualPriceString = batchProductPrice.price
+                    self?.product_Info.individualCnyPriceString = batchProductPrice.cnyPrice
+                    
+                    if self?._paymentMethod == .alipay || self?._paymentMethod == .wxpay {
+                        self?.updatePrice()
                     }
-                    self?.product_Info = product;
-                    for tProduct in products {
-                        if tProduct.id == self?.product_Info.id {
-                            self?.product_Info = product;
+                    self?.priceRefresh(productsModel: self?.product_Info ?? KMListingProductsModel())
+                }
+            } else {
+                model.getDMGProductPriceInfosForMember(productId: product_Info.id, isEducation: 0) { [weak self] success, result in
+                    if success {
+                        guard let productResults : KMMemberProductResult = result else {
+                            return
+                        }
+                        guard let products : [KMListingProductsModel] = productResults.listingProducts else {
+                            return
+                        }
+                        guard let product : KMListingProductsModel = products.first else {
+                            return
+                        }
+                        self?.product_Info = product;
+                        for tProduct in products {
+                            if tProduct.id == self?.product_Info.id {
+                                self?.product_Info = product;
+                            }
                         }
                     }
                 }
@@ -344,7 +372,11 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         refreshLicenseCodeView(isReveal: true)
         refreshLicenseCodeErrorView(isReveal: false)
         
-        removeButton1.isEnabled = false
+        if pdfCount > 1 {
+            removeButton1.isEnabled = true
+        } else {
+            removeButton1.isEnabled = false
+        }
         amountTextField1.delegate = self
 
         couponButton.title = NSLocalizedString("I have a coupon?", comment: "")
@@ -651,11 +683,7 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                     pdfCount += 1
                 }
             }
-            if pdfCount > 1 {
-                removeButton1.isEnabled = true
-            } else {
-                removeButton1.isEnabled = false
-            }
+            
             if pdfCount > 100 {
                 wechatPayButton2.isHidden = false
                 cardButton.isHidden = true
@@ -686,35 +714,8 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         let model = KMProductModel.shared
         isBatchProductPriceGetFinsed = false
         
-        if(pdfCount > 1) {
-            model.getDMGBatchProductPriceInfosForMember(productId: _product_Info.id, num: pdfCount) { [weak self] success, result in
-                guard let pricesArrays : KMMemberProductResult = result else {
-                    return
-                }
-                guard let batchProductPrice : KMBatchProductPriceModel = pricesArrays.batchProductPrice else {
-                    return
-                }
-                //原价更新
-                let priceString = batchProductPrice.totalPrice
-                self?.product_Info.priceString = priceString
-                
-                let cnyPriceString = batchProductPrice.cnyTotalPrice
-                self?.product_Info.cnyPriceString = cnyPriceString //批量时将总价赋给priceString,只显示priceString价格了,其他的置空
-                
-                self?.product_Info.upgradePriceString = nil
-                self?.product_Info.displayPriceString = nil
-                self?.product_Info.displayCnyPriceString = nil
-                self?.product_Info.individualPriceString = batchProductPrice.price
-                self?.product_Info.individualCnyPriceString = batchProductPrice.cnyPrice
-                
-                if self?._paymentMethod == .alipay || self?._paymentMethod == .wxpay {
-                    self?.updatePrice()
-                }
-                self?.priceRefresh(productsModel: self?.product_Info ?? KMListingProductsModel())
-            }
-        } else {
-            updateProduct_Info()
-        }
+        updateProduct_Info()
+
     }
     
     @IBAction func payButtonAction(_ sender: NSButton) {
@@ -784,6 +785,7 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                     self?.product_Info.cnyPriceString = cnyPriceString //批量时将总价赋给priceString,只显示priceString价格了,其他的置空
                     
                     self?.product_Info.upgradePriceString = couponModel.upgradePriceString
+                    self?.product_Info.cnyUpgradePriceString = couponModel.upgradecnyPriceString
                     self?.product_Info.displayPriceString = couponModel.displayPriceString
                     self?.product_Info.displayCnyPriceString = couponModel.displayCnyPriceString
                     
@@ -1079,7 +1081,11 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                 
                 prodocumentView.isHidden = false
             }
-            
+            if pdfCount > 1 {
+                removeButton1.isEnabled = true
+            } else {
+                removeButton1.isEnabled = false
+            }
             if(newValue == "advanced-annual-subscription-trail" ||
                newValue == "ai-subscription-year-trail") {
                 couponView.isHidden = true
@@ -1091,7 +1097,6 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                 for product in products {
                     if product.code == _product_code {
                         self.product_Info = product;
-                        //更新价格
                         self.updateProduct_Info()
                         break
                     }
@@ -1289,7 +1294,11 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         let preferredLanguage = Locale.preferredLanguages.first ?? "en"
         var priceString = product_Info.priceString ?? ""
         if(product_Info.upgradePriceString?.isEmpty == false) {
-            priceString = product_Info.upgradePriceString ?? ""
+            if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "CN" {
+                priceString = product_Info.cnyUpgradePriceString ?? ""
+            } else {
+                priceString = product_Info.upgradePriceString ?? ""
+            }
         } else if(product_Info.displayPriceString?.isEmpty == false) {
             if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "CN" {
                 priceString = product_Info.displayCnyPriceString ?? ""

+ 2 - 0
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -573,9 +573,11 @@ NSPopoverDelegate>
 }
 
 - (IBAction)officeButtonAction:(id)sender {
+#if VERSION_DMG
     DMGEmbeddedOldWC *embeddedWC = [DMGEmbeddedOldWC currentFirstTrialWC:@"com.brother.pdfreaderpro.mac.product_2"];
     [embeddedWC showWindow:nil];
     [embeddedWC.window center];
+#endif
 }
 
 - (NSAttributedString *)numberConvertColor:(NSColor*)color String:(NSString *)string {

+ 14 - 13
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationWindowController.m

@@ -179,19 +179,20 @@ static KMVerificationWindowController *_currentWindowController = nil;
         _activateViewController = [[KMVerificationActivateViewController alloc] init];
         _activateViewController.callback = ^(NSInteger index, NSString *string) {
             if (index == 0) {
-                if (blockSelf.callback) {
-                    blockSelf.callback();
-                    blockSelf.callback = nil;
-                    [blockSelf close];
-                } else {
-                    if (KMVerificationTypeTrial == blockSelf.type) {
-                        [blockSelf setContentView:blockSelf.trialViewController.view];
-                    } else if (KMVerificationTypeActivateExpired == blockSelf.type) {
-                        [blockSelf setContentView:blockSelf.expiredViewController.view];
-                    } else {
-                        [blockSelf setContentView:blockSelf.normalViewController.view];
-                    }
-                }
+//                if (blockSelf.callback) {
+//                    blockSelf.callback();
+//                    blockSelf.callback = nil;
+//                    [blockSelf close];
+//                } else {
+//                    if (KMVerificationTypeTrial == blockSelf.type) {
+//                        [blockSelf setContentView:blockSelf.trialViewController.view];
+//                    } else if (KMVerificationTypeActivateExpired == blockSelf.type) {
+//                        [blockSelf setContentView:blockSelf.expiredViewController.view];
+//                    } else {
+//                        [blockSelf setContentView:blockSelf.normalViewController.view];
+//                    }
+//                }
+                [blockSelf close];
             } else {
                 if (blockSelf.type == KMVerificationTypeActivateAIInfo) {
                     [blockSelf verificationActivateAIInfo:string];

+ 2 - 2
PDF Office/PDF Master/Class/Purchase/IAPProductsManager.m

@@ -134,7 +134,7 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
         if (flagDis.price) {
             price = [self discountFormattedPrice:false price:flagDis.price];
         } else {
-            price = [NSString stringWithFormat:@"USD $%0.2f", [self.offersPrice doubleValue]];
+            price = [NSString stringWithFormat:@"USD $%0.2f", [self.offersPriceNumber doubleValue]];
 #ifndef VERSION_DMG
             // 获取产品价格信息
             [[IAPProductsManager defaultManager] loadAllProducts];
@@ -184,7 +184,7 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
             if (mouths <= 0) {
                 mouths = 1.0;
             }
-            price = [NSString stringWithFormat:@"USD $%0.2f", [self.offersAveragePrice doubleValue]/mouths];
+            price = [NSString stringWithFormat:@"USD $%0.2f", [self.offersPriceNumber doubleValue]/mouths];
         }
 #ifndef VERSION_DMG
         // 获取产品价格信息

+ 2 - 1
PDF Office/PDF Master/MemberCenter/Assets/en.lproj/MemberCenterLocalizable.strings

@@ -194,4 +194,5 @@
 
 "%.2f/year, auto-renewal" = "%.2f/year, auto-renewal";
 "%.2f/Permanent Plan" = "%.2f/Permanent Plan";
-
+"%.2f/monthly, auto-renewal" = "%.2f/monthly, auto-renewal";
+"%.2f/half a year, auto-renewal" = "%.2f/half a year, auto-renewal";

+ 2 - 0
PDF Office/PDF Master/MemberCenter/Assets/zh-Hans.lproj/MemberCenterLocalizable.strings

@@ -188,4 +188,6 @@
 "USD" = "CN";
 
 "%.2f/year, auto-renewal" = "%.2f/年,自动续费";
+"%.2f/half a year, auto-renewal" = "%.2f/半年,自动续费";
+"%.2f/monthly, auto-renewal" = "%.2f/月,自动续费";
 "%.2f/Permanent Plan" = "%.2f/永久版";

+ 2 - 0
PDF Office/PDF Master/MemberCenter/Assets/zh-Hant.lproj/MemberCenterLocalizable.strings

@@ -189,4 +189,6 @@
 "USD" = "TW";
 
 "%.2f/year, auto-renewal" = "%.2f/年,自動續費";
+"%.2f/half a year, auto-renewal" = "%.2f/半年,自動續費";
+"%.2f/monthly, auto-renewal" = "%.2f/月, 自動續費";
 "%.2f/Permanent Plan" = "%.2f/永久版";

+ 22 - 2
PDF Office/PDF Master/MemberCenter/Model/KMMemberCenterManager.swift

@@ -962,7 +962,7 @@ class KMMemberCenterManager: NSObject {
                     var upgradePriceString:String?
                     var cnyPriceString:String?
                     var displayCnyPriceString:String?
-                    
+                    var upgradecnyPriceString:String?
                     
                     if let token = dict1["id"] { id = token as? String ?? id }
                     if let token = dict1["productName"] { productName = token as? String ?? productName }
@@ -987,6 +987,11 @@ class KMMemberCenterManager: NSObject {
                         displayPrice = token
                     }
                     
+                    if let token = dict1["cnyUpgradePrice"] as? NSNumber {
+                        let string = KMFormatNSNumber(token, to: 2)
+                        upgradecnyPriceString = string
+                    }
+                    
                     if let token = dict1["upgradePrice"] as? NSNumber {
                         let string = KMFormatNSNumber(token, to: 2)
                         upgradePriceString = string
@@ -1008,6 +1013,7 @@ class KMMemberCenterManager: NSObject {
                     let products = KMListingProductsModel(id: id, productName: productName, price: priceString, maxDeviceNum: maxDeviceNum, displayPrice: displayPriceString, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, cnyPrice: cnyPriceString, displayCnyPrice: displayCnyPriceString, upgradePrice: upgradePriceString, code: code)
                     products.individualPriceString = priceString
                     products.individualCnyPriceString = cnyPriceString
+                    products.cnyUpgradePriceString = upgradecnyPriceString
                     results.append(products)
                 }
 
@@ -1079,6 +1085,7 @@ class KMMemberCenterManager: NSObject {
                     var upgradePriceString:String?
                     var cnyPriceString:String?
                     var displayCnyPriceString:String?
+                    var upgradecnyPriceString:String?
 
                     if let token = dict1["id"] { id = token as? String ?? id }
                     if let token = dict1["productName"] { productName = token as? String ?? productName }
@@ -1116,8 +1123,14 @@ class KMMemberCenterManager: NSObject {
                         displayCnyPriceString = string
                         displayCnyPrice = token
                     }
+                    
+                    if let token = dict1["cnyUpgradePrice"] as? NSNumber {
+                        let string = KMFormatNSNumber(token, to: 2)
+                        upgradecnyPriceString = string
+                    }
 
                     let products = KMListingProductsModel(id: id, productName: productName, price: priceString, maxDeviceNum: maxDeviceNum, displayPrice: displayPriceString, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, cnyPrice: cnyPriceString, displayCnyPrice: displayCnyPriceString, upgradePrice: upgradePriceString, code: code)
+                    products.cnyUpgradePriceString = upgradecnyPriceString
                     products.individualPriceString = priceString
                     products.individualCnyPriceString = cnyPriceString
                     results.append(products)
@@ -1256,7 +1269,7 @@ class KMMemberCenterManager: NSObject {
                 var upgradePriceString:String?
                 var cnyPriceString:String?
                 var displayCnyPriceString:String?
-                
+                var upgradecnyPriceString:String?
                 
                 if let token = result["id"] { id = token as? String ?? id }
                 if let token = result["productName"] { productName = token as? String ?? productName }
@@ -1294,8 +1307,15 @@ class KMMemberCenterManager: NSObject {
                     displayCnyPriceString = string
                     displayCnyPrice = token
                 }
+                
+                if let token = result["cnyUpgradePrice"] as? NSNumber {
+                    let string = KMFormatNSNumber(token, to: 2)
+                    upgradecnyPriceString = string
+                }
 
                 let products = KMCheckCouponModel(id: id, productName: productName, price: priceString, maxDeviceNum: maxDeviceNum, displayPrice: displayPriceString, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, cnyPrice: cnyPriceString, displayCnyPrice: displayCnyPriceString, upgradePrice: upgradePriceString, code: code)
+                products.upgradecnyPriceString = upgradecnyPriceString
+                
                 let result1 = KMMemberProductResult(code: requestCode, msg: message, checkCoupon: products)
                 if requestCode == 200 {
                     complete(true, result1)

+ 4 - 2
PDF Office/PDF Master/MemberCenter/Model/KMMemberProductResult.swift

@@ -97,7 +97,8 @@ class KMListingProductsModel: NSObject {
     var displayCnyPriceString  : String? // 【可选】人民币优惠价格
     var displayPriceString     : String? // 【可选】教育优惠价格
     var upgradePriceString    : String? // 【可选】买断升级订阅价格
-    
+    var cnyUpgradePriceString    : String? // 【可选】买断升级订阅价格
+
     var individualPriceString    : String? // 每个单价
     var individualCnyPriceString    : String? // 每个单价
 
@@ -168,7 +169,8 @@ class KMCheckCouponModel: NSObject {
     var displayPriceString    : String? // 【可选】教育优惠价格
     var upgradePriceString    : String? // 【可选】买断升级订阅价格
     var verifyofferCode   : String = "" // 优惠码
-    
+    var upgradecnyPriceString:String?
+
     init(id: String, productName: String, price: String?, maxDeviceNum: Int, displayPrice: String?, levels: String, platforms: String, productLineId: Int, paymentModel: Int, cycle: Int, cnyPrice: String?, displayCnyPrice:  String?, upgradePrice:  String?, code: String) {
         self.id = id
         self.productName = productName

+ 79 - 3
PDF Office/PDF Master/MemberCenter/ViewModel/KMProductModel.swift

@@ -418,6 +418,74 @@ class KMProductModel: ObservableObject {
             } else if userScenarioType == .pro_type3 {
                 state = .pro_Base
             }
+        } else if userScenarioType == .dmg_type4 ||
+                    userScenarioType == .dmg_type5 ||
+                    userScenarioType == .dmg_type6 ||
+                    userScenarioType == .dmg_type7 ||
+                    userScenarioType == .dmg_type8 ||
+                    userScenarioType == .dmg_type9 ||
+                    userScenarioType == .dmg_type10 ||
+                    userScenarioType == .dmg_type11 ||
+                    userScenarioType == .dmg_type12 ||
+                    userScenarioType == .dmg_type13 ||
+                    userScenarioType == .dmg_type14 ||
+                    userScenarioType == .dmg_type15 ||
+                    userScenarioType == .dmg_type16 ||
+                    userScenarioType == .dmg_type17 ||
+                    userScenarioType == .dmg_type18 ||
+                    userScenarioType == .dmg_type19 ||
+                    userScenarioType == .dmg_type20 ||
+                    userScenarioType == .dmg_type21 ||
+                    userScenarioType == .dmg_type22 ||
+                    userScenarioType == .dmg_type23 ||
+                    userScenarioType == .dmg_type24 ||
+                    userScenarioType == .dmg_type25 ||
+                    userScenarioType == .dmg_type26 ||
+                    userScenarioType == .dmg_type27 ||
+                    userScenarioType == .dmg_type28 ||
+                    userScenarioType == .dmg_type29 ||
+                    userScenarioType == .dmg_type30 ||
+                    userScenarioType == .dmg_type31 ||
+                    userScenarioType == .dmg_type32 ||
+                    userScenarioType == .dmg_type33 ||
+                    userScenarioType == .dmg_type34 ||
+                    userScenarioType == .dmg_type35 ||
+                    userScenarioType == .dmg_type36 ||
+                    userScenarioType == .dmg_type37 ||
+                    userScenarioType == .dmg_type38 ||
+                    userScenarioType == .dmg_type39 ||
+                    userScenarioType == .dmg_type40 ||
+                    userScenarioType == .dmg_type41 ||
+                    userScenarioType == .dmg_type42 ||
+                    userScenarioType == .dmg_type43 ||
+                    userScenarioType == .dmg_type44 ||
+                    userScenarioType == .dmg_type45 ||
+                    userScenarioType == .dmg_type46 ||
+                    userScenarioType == .dmg_type47 ||
+                    userScenarioType == .dmg_type48 {
+            if userScenarioType == .dmg_type4 ||
+                userScenarioType == .dmg_type19 ||
+                userScenarioType == .dmg_type34 {
+                state = .trial
+            } else if userScenarioType == .dmg_type5 ||
+                        userScenarioType == .dmg_type28 ||
+                        userScenarioType == .dmg_type43 {
+                state = .dmg_Upgrades1
+            } else if userScenarioType == .dmg_type6 ||
+                        userScenarioType == .dmg_type7 ||
+                        userScenarioType == .dmg_type29 ||
+                        userScenarioType == .dmg_type30 ||
+                        userScenarioType == .dmg_type44 ||
+                        userScenarioType == .dmg_type45 {
+                state = .dmg_Upgrades2
+            } else if userScenarioType == .dmg_type11 ||
+                        userScenarioType == .dmg_type18 ||
+                        userScenarioType == .dmg_type22 ||
+                        userScenarioType == .dmg_type33 ||
+                        userScenarioType == .dmg_type37 ||
+                        userScenarioType == .dmg_type48 {
+                state = .dmg_Base
+            }
         }
     }
     
@@ -441,7 +509,7 @@ class KMProductModel: ObservableObject {
                     } else {
                         return String(format: "CNY ¥%@", getDMGCNYPrice(productCode: KMAdvancedAnnualSubscriptionBlackFiveCodeKey_DMG))
                     }
-                } else if KMMemberInfo.shared.canTrail {
+                } else if KMMemberInfo.shared.canTrail && state == .trial {
                     if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "USD" {
                         return String(format: "USD $%@", getDMGPrice(productCode: KMAdvancedAnnualSubscriptionTrailCodeKey_DMG))
                     } else {
@@ -594,7 +662,7 @@ class KMProductModel: ObservableObject {
             } else {
                 if isBlackFive {
                     code = KMAdvancedAnnualSubscriptionBlackFiveCodeKey_DMG
-                } else if KMMemberInfo.shared.canTrail {
+                } else if KMMemberInfo.shared.canTrail && state == .trial {
                     code = KMAdvancedAnnualSubscriptionTrailCodeKey_DMG
                 } else {
                     code = KMAdvancedAnnualSubscriptionCodeKey_DMG
@@ -676,7 +744,15 @@ class KMProductModel: ObservableObject {
 #if VERSION_FREE
 #if VERSION_DMG
     // DMG
-            let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode(KMAdvancedAnnualSubscriptionCodeKey_DMG)
+            var code = ""
+            if isBlackFive {
+                code = KMAdvancedAnnualSubscriptionBlackFiveCodeKey_DMG
+            } else if KMMemberInfo.shared.canTrail && state == .trial {
+                code = KMAdvancedAnnualSubscriptionTrailCodeKey_DMG
+            } else {
+                code = KMAdvancedAnnualSubscriptionCodeKey_DMG
+            }
+            let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode(code)
             embeddedWC.showWindow(nil)
             embeddedWC.window?.center()
 #else

+ 6 - 1
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -370,7 +370,7 @@ class KMProductCompareWC: NSWindowController {
 #if VERSION_FREE
 #if VERSION_DMG
     // DMG
-        if KMMemberInfo.shared.canTrail {
+        if KMMemberInfo.shared.canTrail && model.state == .trial {
             advancedPlanPurchaseLbl.stringValue = NSLocalizedString("Free Trial", comment: "")
         }
         if model.state == .dmg_Base {
@@ -1133,6 +1133,10 @@ class KMProductCompareWC: NSWindowController {
     }
     
     @IBAction func appstorePurchaseAction(_ sender: NSButton) {
+        if KMMemberInfo.shared.validFlag == "5" {
+            KMMemberPromptWC.shared.showWindow(nil)
+            KMMemberPromptWC.shared.tipType = .signouting
+        } else {
 #if !VERSION_DMG
         addWaitingView(to: window?.contentView ?? NSView())
 #endif
@@ -1143,6 +1147,7 @@ class KMProductCompareWC: NSWindowController {
 #if VERSION_DMG
         close()
 #endif
+        }
     }
     
     // MARK: - InAppPurchaseManager Notification