File tree 4 files changed +12
-6
lines changed
4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -158,9 +158,15 @@ class BadgeManager {
158
158
let prefs = AppStateManager . shared. preferences
159
159
let hasPendingUpdates = !prefs. hiddenCards. contains ( " PendingAppUpdates " ) && AppStateManager . shared. pendingUpdatesCount > 0
160
160
let hasSoftwareUpdates = !prefs. hiddenActions. contains ( " SoftwareUpdates " ) && AppStateManager . shared. systemUpdateCache. count > 0
161
- NSApplication . shared. dockTile. showsApplicationBadge = hasPendingUpdates || hasSoftwareUpdates
162
- NSApplication . shared. dockTile. badgeLabel = nil
163
- NSApplication . shared. dockTile. badgeLabel = String ( self . badgeCount)
161
+ if hasPendingUpdates || hasSoftwareUpdates {
162
+ NSApplication . shared. dockTile. showsApplicationBadge = true
163
+ NSApplication . shared. dockTile. badgeLabel = nil
164
+ NSApplication . shared. dockTile. badgeLabel = String ( self . badgeCount)
165
+ } else {
166
+ NSApplication . shared. dockTile. showsApplicationBadge = false
167
+ NSApplication . shared. dockTile. badgeLabel = nil
168
+ }
169
+
164
170
} else {
165
171
NSApplication . shared. dockTile. badgeLabel = nil
166
172
NSApplication . shared. dockTile. showsApplicationBadge = false
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ class PendingIntuneUpdatesManager {
90
90
self . appState. pendingUpdatesCount = updates
91
91
}
92
92
}
93
- if updates > 0 {
93
+ if updates > 0 && !appState . preferences . hiddenCards . contains ( " PendingAppUpdates " ) {
94
94
NotificationService ( appState: appState) . sendNotification (
95
95
message: appState. preferences. appUpdateNotificationMessage,
96
96
buttonText: appState. preferences. appUpdateNotificationButtonText,
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ class PendingMunkiUpdatesManager {
120
120
self . appState. pendingUpdatesCount = updates
121
121
}
122
122
}
123
- if updates > 0 {
123
+ if updates > 0 && !appState . preferences . hiddenCards . contains ( " PendingAppUpdates " ) {
124
124
NotificationService ( appState: appState) . sendNotification (
125
125
message: appState. preferences. appUpdateNotificationMessage,
126
126
buttonText: appState. preferences. appUpdateNotificationButtonText,
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class SystemUpdatesManager: ObservableObject {
38
38
monitorTask = Task {
39
39
while !Task. isCancelled {
40
40
do {
41
- let result = await ActionHelpers . getSystemUpdateStatus ( sendNotification: true )
41
+ let result = await ActionHelpers . getSystemUpdateStatus ( sendNotification: !appState . preferences . hiddenActions . contains ( " SoftwareUpdates " ) )
42
42
switch result {
43
43
case . success( let ( count, updates) ) :
44
44
if count != self . previousUpdateCount {
You can’t perform that action at this time.
0 commit comments