|
@@ -29,7 +29,7 @@ class KMCouponDueWindowController: NSWindowController {
|
|
|
var endUpAt: String = ""
|
|
|
|
|
|
deinit {
|
|
|
- print("KMCouponDueWindowController deInit")
|
|
|
+ NotificationCenter.default.removeObserver(self)
|
|
|
}
|
|
|
|
|
|
override func windowDidLoad() {
|
|
@@ -55,14 +55,16 @@ class KMCouponDueWindowController: NSWindowController {
|
|
|
}
|
|
|
self.buyButton.setTitleColor(NSColor.white)
|
|
|
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(recommondInfoUpdateNoti), name: NSNotification.Name("KMRecommondInfoUpdateNoti"), object: nil)
|
|
|
+
|
|
|
}
|
|
|
|
|
|
func refreshUI() {
|
|
|
if KMAppearance.isDarkMode() {
|
|
|
self.window?.contentView?.layer?.backgroundColor = NSColor(red: 24/255, green: 22/255, blue: 31/255, alpha: 1).cgColor
|
|
|
- self.titleLabel.textColor = KMAppearance.KMColor_Layout_L0()
|
|
|
- self.subTitleLabel.textColor = KMAppearance.KMColor_Layout_L0()
|
|
|
- self.laterInfoLabel.textColor = KMAppearance.KMColor_Layout_L0()
|
|
|
+ self.titleLabel.textColor = NSColor(red: 252/255, green: 253/255, blue: 255/255, alpha: 1)
|
|
|
+ self.subTitleLabel.textColor = NSColor(red: 252/255, green: 253/255, blue: 255/255, alpha: 1)
|
|
|
+ self.laterInfoLabel.textColor = NSColor(red: 252/255, green: 253/255, blue: 255/255, alpha: 1)
|
|
|
|
|
|
} else {
|
|
|
self.window?.contentView?.layer?.backgroundColor = NSColor(red: 245/255, green: 249/255, blue: 255/255, alpha: 1).cgColor
|
|
@@ -105,4 +107,21 @@ class KMCouponDueWindowController: NSWindowController {
|
|
|
FMTrackEventManager.defaultManager.trackEvent(event: "PUW", withProperties: ["PUW_Btn" : "Btn_PUW_TrialExpireOffer_Buy"])
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @objc func recommondInfoUpdateNoti(_ notification: Notification) {
|
|
|
+ DispatchQueue.main.async {
|
|
|
+ guard let dict = notification.object as? NSDictionary else {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ guard let unique = dict["unique"] as? String else {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if unique == KMAdsInfoManager.shareInstance.couponInfo?.versionKey {
|
|
|
+ self.reloadData()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|