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 = '';