From 84ec43105cdef17f7e57673487ed38a855a89a0e Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 13 Apr 2026 21:33:43 -0500 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 9618619f7..786b7c60b 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -180,6 +180,12 @@ } const navigateHandler = async () => { + // Mark the outgoing chat as read before loading the new one. + // $chatId still holds the previous chat here — loadChat() updates it. + if ($chatId && $chatId !== chatIdProp && !$temporaryChatEnabled) { + updateLastReadAt($chatId); + } + loading = true; prompt = '';