From f91e56d6df7b842b6e928a08bcb8e2325e3a43ed Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 24 Dec 2024 21:28:35 -0700 Subject: [PATCH] refac --- src/routes/+layout.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index b7322a06f..896d1fef4 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -19,7 +19,8 @@ chatId, chats, currentChatPage, - tags + tags, + temporaryChatEnabled } from '$lib/stores'; import { goto } from '$app/navigation'; import { page } from '$app/stores'; @@ -94,7 +95,10 @@ const chatEventHandler = async (event) => { const chat = $page.url.pathname.includes(`/c/${event.chat_id}`); - if (!chat || document.visibilityState !== 'visible') { + if ( + (!(chat || event.chat_id === $chatId) && !$temporaryChatEnabled) || + document.visibilityState !== 'visible' + ) { await tick(); const type = event?.data?.type ?? null; const data = event?.data?.data ?? null;