Browse Source

【会员系统】登录退出时页面设置界面补充刷新相关逻辑

wangshuai 4 tháng trước cách đây
mục cha
commit
3a1e8aa40a

+ 10 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayPropertiesViewController.swift

@@ -306,6 +306,8 @@ class KMPageDisplayPropertiesButton: NSButton {
 
         NotificationCenter.default.addObserver(self, selector: #selector(removeSecondaryPdfContentView(_:)), name: NSNotification.Name("KMSplitSinglePageNotification"), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(viewModeChangeUpdateState(_:)), name: Notification.Name("CPDFListViewDisplayModeChangeNotification"), object: nil)
+        NotificationCenter.default.addObserver(self, selector: #selector(loginSuccessNotification), name: NSNotification.Name(rawValue: "MemberCenterLoginSuccess"), object: nil)
+        NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccessNotification), name: NSNotification.Name(rawValue: "MemberCenterLogoutSuccess"), object: nil)
     }
     
     private func reloadReplaceView() {
@@ -633,6 +635,14 @@ class KMPageDisplayPropertiesButton: NSButton {
     @objc func viewModeChangNotification(_ notification: Notification) {
         reloadData()
     }
+    
+    @objc func loginSuccessNotification() -> Void {
+        themeCollectionView.reloadData()
+    }
+    
+    @objc func logoutSuccessNotification() -> Void {
+        themeCollectionView.reloadData()
+    }
 
 //    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
 //        guard let object = object as? YourObjectType, keyPath == "yourKeyPath" else {