diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index ae66e5c2f..b0d3aee6b 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -11,7 +11,6 @@ import { onMount, tick, getContext } from 'svelte'; const i18n = getContext('i18n'); - let messageElement: HTMLElement; const dispatch = createEventDispatcher(); @@ -134,8 +133,9 @@ }; const renderLatex = () => { - let chatMessageElements = messageElement.getElementsByClassName('chat-assistant'); - // let lastChatMessageElement = chatMessageElements[chatMessageElements.length - 1]; + let chatMessageElements = document + .getElementById(`message-${message.id}`) + ?.getElementsByClassName('chat-assistant'); for (const element of chatMessageElements) { auto_render(element, { @@ -323,7 +323,7 @@ {#key message.id} -