mirror of
https://github.com/open-webui/open-webui
synced 2025-01-31 15:01:00 +00:00
refac
This commit is contained in:
parent
e63c0aeb1b
commit
656a887db6
@ -839,7 +839,8 @@
|
|||||||
if (res !== null && res.messages) {
|
if (res !== null && res.messages) {
|
||||||
// Update chat history with the new messages
|
// Update chat history with the new messages
|
||||||
for (const message of res.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],
|
...history.messages[message.id],
|
||||||
...(history.messages[message.id].content !== message.content
|
...(history.messages[message.id].content !== message.content
|
||||||
@ -1350,7 +1351,8 @@
|
|||||||
history.currentId = responseMessageId;
|
history.currentId = responseMessageId;
|
||||||
|
|
||||||
// Append messageId to childrenIds of parent message
|
// 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 = [
|
||||||
...history.messages[parentId].childrenIds,
|
...history.messages[parentId].childrenIds,
|
||||||
responseMessageId
|
responseMessageId
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
const { saveAs } = fileSaver;
|
const { saveAs } = fileSaver;
|
||||||
|
|
||||||
import { marked, type Token } from 'marked';
|
import { marked, type Token } from 'marked';
|
||||||
import { revertSanitizedResponseContent, unescapeHtml } from '$lib/utils';
|
import { unescapeHtml } from '$lib/utils';
|
||||||
|
|
||||||
import { WEBUI_BASE_URL } from '$lib/constants';
|
import { WEBUI_BASE_URL } from '$lib/constants';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user