From ee2f09d6f02176bdb2a21cc96b980202be0ccb84 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sat, 5 Dec 2026 04:56:21 +0100 Subject: [PATCH] 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 --- src/routes/+layout.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 6b533f2b3b..9490c8134e 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -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; } }