fix: desktop app shows a toast for every finished reply, even in the chat on screen (#35626)

In the desktop app, every finished reply popped up a toast even when that chat was open and the window was focused. Open WebUI asks the desktop app whether its window is focused, and current desktop versions do not support that request and answer with an error, which was read as "not focused". Only a real answer now counts, and otherwise the page's own visibility decides as in a normal browser.

Fixes #35622
This commit is contained in:
Classic298 authored and GitHub committed 2026-12-05 07:56:21 +04:00
1 parent 259fe51cb7
commit ee2f09d6f0
1 file changed
+2 -2
+2 -2
View File
@@ -504,7 +504,7 @@
const res = await window.electronAPI.send({
type: 'window:isFocused'
});
if (res) {
if (typeof res?.isFocused === 'boolean') {
isInBackground = !res.isFocused;
}
}
@@ -664,7 +664,7 @@
const res = await window.electronAPI.send({
type: 'window:isFocused'
});
if (res) {
if (typeof res?.isFocused === 'boolean') {
isInBackground = !res.isFocused;
}
}