fix(tray): prevent stale progress bar events from overriding stopped icon

Guard the SET_PROGRESS_BAR tray icon update with an _isRunning check so
that late IPC events (e.g. trailing throttle emissions from focus mode)
cannot override the correct stopped icon after a task is unset.

Closes #3410
This commit is contained in:
Johannes Millan 2026-03-19 16:20:45 +01:00
parent 0385204eb3
commit 29441b7ae2

View file

@ -146,7 +146,9 @@ function initListeners(): void {
});
ipcMain.on(IPC.SET_PROGRESS_BAR, (ev: IpcMainEvent, { progress }) => {
setTrayIcon(tray, getRunningIconPath(progress));
if (_isRunning) {
setTrayIcon(tray, getRunningIconPath(progress));
}
// Also update the context menu and tray title during the progress bar tick
// This perfectly synchronizes the text "blinking" with the pie chart animation