@@ -135,7 +135,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
135135 defaults. addObserver ( self , forKeyPath: " PasswordExpiryLimit " , options: . new, context: nil )
136136 defaults. addObserver ( self , forKeyPath: " OpenAtLogin " , options: . new, context: nil )
137137 restrictionsDefaults? . addObserver ( self , forKeyPath: " forceDelayedMajorSoftwareUpdates " , options: . new, context: nil )
138- ASUdefaults ? . addObserver ( self , forKeyPath: " LastUpdatesAvailable " , options: . new, context: nil )
138+ // ASUdefaults?.addObserver(self, forKeyPath: "LastUpdatesAvailable", options: .new, context: nil)
139139 ASUdefaults ? . addObserver ( self , forKeyPath: " RecommendedUpdates " , options: . new, context: nil )
140140
141141 // Observe changes for Extensions A and B
@@ -157,8 +157,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
157157 // Receive notification after password expiry check
158158 NotificationCenter . default. addObserver ( self , selector: #selector( setStatusBarIcon) , name: Notification . Name. passwordExpiryLimit, object: nil )
159159
160- // Receive notification after major macOS update check
161- NotificationCenter . default. addObserver ( self , selector: #selector( setStatusBarIcon) , name: Notification . Name. majorVersionUpdates , object: nil )
160+ // Receive notification after macOS update check
161+ NotificationCenter . default. addObserver ( self , selector: #selector( setStatusBarIcon) , name: Notification . Name. recommendedUpdates , object: nil )
162162
163163 // Run functions at startup
164164 runAtStartup ( )
@@ -337,12 +337,12 @@ class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
337337 // Check if StatusBarItem notifier is enabled
338338 if defaults. bool ( forKey: " StatusBarIconNotifierEnabled " ) {
339339 // Show notification badge in menu bar icon when info item when needed
340- if ( ( computerinfo. updatesAvailableToShow == 0 || !infoItemsEnabled. contains ( " MacOSVersion " ) ) && ( appCatalogController. appUpdates == 0 || !infoItemsEnabled. contains ( " AppCatalog " ) ) ) && ( ( computerinfo. uptimeLimitReached && infoItemsEnabled. contains ( " Uptime " ) ) || ( computerinfo. selfSignedIP && infoItemsEnabled. contains ( " Network " ) ) || ( userinfo. passwordExpiryLimitReached && infoItemsEnabled. contains ( " Password " ) ) || ( computerinfo. storageLimitReached && infoItemsEnabled. contains ( " Storage " ) ) || ( preferences. extensionAlertA && infoItemsEnabled. contains ( " ExtensionA " ) ) || ( preferences. extensionAlertB && infoItemsEnabled. contains ( " ExtensionB " ) ) ) {
340+ if ( ( computerinfo. recommendedUpdates . count == 0 || !infoItemsEnabled. contains ( " MacOSVersion " ) ) && ( appCatalogController. appUpdates == 0 || !infoItemsEnabled. contains ( " AppCatalog " ) ) ) && ( ( computerinfo. uptimeLimitReached && infoItemsEnabled. contains ( " Uptime " ) ) || ( computerinfo. selfSignedIP && infoItemsEnabled. contains ( " Network " ) ) || ( userinfo. passwordExpiryLimitReached && infoItemsEnabled. contains ( " Password " ) ) || ( computerinfo. storageLimitReached && infoItemsEnabled. contains ( " Storage " ) ) || ( preferences. extensionAlertA && infoItemsEnabled. contains ( " ExtensionA " ) ) || ( preferences. extensionAlertB && infoItemsEnabled. contains ( " ExtensionB " ) ) ) {
341341
342342 // Create orange notification badge
343343 orangeBadge. isHidden = false
344344
345- } else if ( computerinfo. updatesAvailableToShow > 0 && infoItemsEnabled. contains ( " MacOSVersion " ) ) || ( appCatalogController. appUpdates > 0 && infoItemsEnabled. contains ( " AppCatalog " ) ) {
345+ } else if ( computerinfo. recommendedUpdates . count > 0 && infoItemsEnabled. contains ( " MacOSVersion " ) ) || ( appCatalogController. appUpdates > 0 && infoItemsEnabled. contains ( " AppCatalog " ) ) {
346346
347347 // Create red notification badge
348348 redBadge. isHidden = false
@@ -439,8 +439,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
439439 Task {
440440 await self . userinfo. getCurrentUserRecord ( )
441441 }
442- case " LastUpdatesAvailable " :
443- logger. debug ( " \( keyPath! as NSObject , privacy: . public) changed to \( self . ASUdefaults!. integer ( forKey: " LastUpdatesAvailable " ) , privacy: . public) " )
442+ // case "LastUpdatesAvailable":
443+ // logger.debug("\(keyPath! as NSObject, privacy: .public) changed to \(self.ASUdefaults!.integer(forKey: "LastUpdatesAvailable"), privacy: .public)")
444444 case " RecommendedUpdates " :
445445 logger. debug ( " \( keyPath! as NSObject , privacy: . public) changed, checking update contents... " )
446446 self . computerinfo. getRecommendedUpdates ( )
0 commit comments