diff --git a/Evergreen/DockBadge.swift b/Evergreen/DockBadge.swift index 3ac899833..af3ea8ee0 100644 --- a/Evergreen/DockBadge.swift +++ b/Evergreen/DockBadge.swift @@ -15,16 +15,12 @@ import RSCore func update() { - performSelectorCoalesced(#selector(updateBadge), with: nil, delay: 0.01) + appDelegate?.coalescingQueue.add(self, #selector(updateBadge)) } - @objc dynamic func updateBadge() { + @objc func updateBadge() { - guard let appDelegate = appDelegate else { - return - } - - let unreadCount = appDelegate.unreadCount + let unreadCount = appDelegate?.unreadCount ?? 0 let label = unreadCount > 0 ? "\(unreadCount)" : "" NSApplication.shared.dockTile.badgeLabel = label }