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; } }