From 5d4f16bcc9af1afac55dc0ffb4dced96041531a5 Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Thu, 15 Oct 2026 19:48:05 -0400 Subject: [PATCH] fix: refreshing a new chat with Landing Page Mode set to Chat no longer throws a TypeError (#32510) With Settings > Interface > Landing Page Mode set to Chat, the new chat page renders the message list, so the block that reveals a message picked from search ran there too. With no chat open, chat?.id and $page.params.id are both undefined, the guard passed, and chat.id threw "can't access property 'id'" on every refresh. Require a chat before comparing its id with the page's. --- src/lib/components/chat/Chat.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 4883c4a219..a7cafd0c4c 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1225,7 +1225,7 @@ }; let revealedSearchMessage = ''; - $: if (!embedded && !loading && messagesRef && chat?.id === $page.params.id) { + $: if (!embedded && !loading && messagesRef && chat && chat.id === $page.params.id) { const target = $page.url.searchParams.get('message'); const key = `${chat.id}:${target}`; if (target && history.messages[target] && key !== revealedSearchMessage) {