fix: opening a message from Search drops it from the address (#35000)

Opening a search result jumps to the matching message, but the address dropped the message right away. A reload or a copied address then opened the chat at its latest message instead. The address now keeps the message the chat was opened at, so a reload lands on it again.

Fixes #34502
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-25 03:28:33 +04:00
1 parent b87c99f44f
commit b9e9857b1c
1 file changed
+3
+3
View File
@@ -1975,6 +1975,9 @@
if ($temporaryChat !== ($settings?.temporaryChatByDefault ?? false))
url.searchParams.set('temporary-chat', String($temporaryChat));
else if (url.searchParams.has('temporary-chat')) url.searchParams.delete('temporary-chat');
} else if (active?.id === mainChatTabId && url.pathname === get(page).url.pathname) {
// Keep the query, such as ?message=, so a reload lands there again.
url.search = get(page).url.search;
}
if (url.origin === location.origin && url.href !== location.href) {
// Reflect selection without routing through SvelteKit and remounting the workspace.