diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 043fcdbb50..906637e75a 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1989,6 +1989,13 @@ // Web functions ////////////////////////// + const openCallOverlay = () => { + setTimeout(() => { + showCallOverlay.set(true); + showControls.set(true); + }, 0); + }; + const initNewChat = async () => { console.log('initNewChat'); resetWebSearchConfirmation(); @@ -2176,8 +2183,7 @@ } if ($page.url.searchParams.get('call') === 'true') { - showCallOverlay.set(true); - showControls.set(true); + openCallOverlay(); } // Consume one-shot desktop event (e.g. Spotlight query, call shortcut) @@ -2186,13 +2192,7 @@ desktopEvent.set(null); if (event.type === 'call') { - // Defer to next macrotask so the call overlay isn't clobbered by - // showControlsSubscribe's initial callback (value=false → set(false)) - // which runs as a pending microtask after this function. - setTimeout(() => { - showCallOverlay.set(true); - showControls.set(true); - }, 0); + openCallOverlay(); } else if (event.type === 'query') { const query = event.data?.query; const eventFiles = event.data?.files;