fix: open the thread when a notification toast for a thread reply is clicked (#29856)

This commit is contained in:
G30 2026-09-09 16:24:10 -04:00 committed by GitHub
parent 5b0f8a73ca
commit b198c94efb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -3,6 +3,7 @@
import { onDestroy, onMount, tick } from 'svelte';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { v4 as uuidv4 } from 'uuid';
import {
@ -48,6 +49,11 @@
initHandler();
}
$: if (channel && $page.url.searchParams.get('thread')) {
threadId = $page.url.searchParams.get('thread');
window.history.replaceState(history.state, '', `/channels/${id}`);
}
const scrollToBottom = () => {
if (messagesContainerElement) {
messagesContainerElement.scrollTop = messagesContainerElement.scrollHeight;

View file

@ -864,7 +864,9 @@
toast.custom(NotificationToast, {
componentProps: {
onClick: () => {
goto(`/channels/${event.channel_id}`);
goto(
`/channels/${event.channel_id}${data?.parent_id ? `?thread=${data.parent_id}` : ''}`
);
},
content: data?.content,
title: `${title}`