From 4442411f40ceca2017efbfaca839b5b033f16d95 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 24 Dec 2024 21:16:09 -0700 Subject: [PATCH] refac --- src/routes/+layout.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;