update menu and count before auto-upgrade starts
fetchOutdated returned before refreshing the UI when auto-upgrade triggered, so the menu showed stale state for the whole upgrade. Now the fetched list lands in the menu, status line and menu bar count first; runAutoUpgrade then overwrites the status with its own message. Notification stays after the post-upgrade refetch — leftovers only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
813fc47461
commit
c296c03ee5
|
|
@ -266,6 +266,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||||
|
|
||||||
self.cachedOutdated = outdated
|
self.cachedOutdated = outdated
|
||||||
|
|
||||||
|
// reflect what was found before any auto-upgrade starts, so the
|
||||||
|
// menu shows the real list while the upgrade is running
|
||||||
|
self.updateOutdatedMenu(with: outdated)
|
||||||
|
self.updateStatus(count: outdated.count)
|
||||||
|
self.updateMenuBarCount()
|
||||||
|
|
||||||
// only trigger for the kinds that are both enabled AND outdated —
|
// only trigger for the kinds that are both enabled AND outdated —
|
||||||
// e.g. an outdated cask must not start a pointless formulae upgrade
|
// e.g. an outdated cask must not start a pointless formulae upgrade
|
||||||
let upgradeFormulae = Settings.autoUpgradeFormulae && !outdated.formulae.isEmpty
|
let upgradeFormulae = Settings.autoUpgradeFormulae && !outdated.formulae.isEmpty
|
||||||
|
|
@ -275,9 +281,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
self.updateOutdatedMenu(with: outdated)
|
// notify only about what auto-upgrade didn't (or couldn't) handle
|
||||||
self.updateStatus(count: outdated.count)
|
|
||||||
self.updateMenuBarCount()
|
|
||||||
self.notifyIfNeeded(outdated: outdated.all.map(\.name))
|
self.notifyIfNeeded(outdated: outdated.all.map(\.name))
|
||||||
if outdated.isEmpty {
|
if outdated.isEmpty {
|
||||||
self.setMenuBarIcon("brewbar-uptodate")
|
self.setMenuBarIcon("brewbar-uptodate")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue