diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index a82009c4d..b7322a06f 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -92,7 +92,9 @@ }; const chatEventHandler = async (event) => { - if (event.chat_id !== $chatId || document.visibilityState !== 'visible') { + const chat = $page.url.pathname.includes(`/c/${event.chat_id}`); + + if (!chat || document.visibilityState !== 'visible') { await tick(); const type = event?.data?.type ?? null; const data = event?.data?.data ?? null;