fix: check window focus before summarization to avoid wasted Zen API calls

When notificationMode is 'hidden-only', the isWindowFocused check now
happens before summarization and template resolution, not after. This
prevents costly Zen API calls for notifications that would be skipped
anyway, and eliminates stale notifications arriving after the user has
already read the response and switched away.
This commit is contained in:
Bohdan Triapitsyn
2026-05-13 17:43:08 +03:00
parent ef2dc8751d
commit 7fb5ad0f48
3 changed files with 29 additions and 0 deletions
+1
View File
@@ -785,6 +785,7 @@ const spawnLocalServer = async () => {
attachSignals: false,
exitOnShutdown: false,
onDesktopNotification: (payload) => maybeShowNativeNotification(payload),
getIsWindowFocused: isAnyWindowFocused,
});
const port = handle.getPort();