This commit is contained in:
Timothy Jaeryang Baek 2025-01-08 00:10:38 -08:00
parent e63c0aeb1b
commit 656a887db6
2 changed files with 5 additions and 3 deletions

View File

@ -839,7 +839,8 @@
if (res !== null && res.messages) {
// Update chat history with the new messages
for (const message of res.messages) {
if (message && message.id) { // Add null check for message and message.id
if (message?.id) {
// Add null check for message and message.id
history.messages[message.id] = {
...history.messages[message.id],
...(history.messages[message.id].content !== message.content
@ -1350,7 +1351,8 @@
history.currentId = responseMessageId;
// Append messageId to childrenIds of parent message
if (parentId !== null && history.messages[parentId]) { // Add null check before accessing childrenIds
if (parentId !== null && history.messages[parentId]) {
// Add null check before accessing childrenIds
history.messages[parentId].childrenIds = [
...history.messages[parentId].childrenIds,
responseMessageId

View File

@ -7,7 +7,7 @@
const { saveAs } = fileSaver;
import { marked, type Token } from 'marked';
import { revertSanitizedResponseContent, unescapeHtml } from '$lib/utils';
import { unescapeHtml } from '$lib/utils';
import { WEBUI_BASE_URL } from '$lib/constants';