mirror of
https://github.com/open-webui/open-webui
synced 2025-05-23 14:24:22 +00:00
Merge pull request #8377 from Vojtech-Siler/multiple-error-fixes
fix: Multiple Fixes for Range and Type Errors
This commit is contained in:
commit
e0054298a4
@ -839,6 +839,7 @@
|
|||||||
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
|
||||||
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
|
||||||
@ -848,6 +849,7 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await tick();
|
await tick();
|
||||||
|
|
||||||
@ -1348,7 +1350,7 @@
|
|||||||
history.currentId = responseMessageId;
|
history.currentId = responseMessageId;
|
||||||
|
|
||||||
// Append messageId to childrenIds of parent message
|
// Append messageId to childrenIds of parent message
|
||||||
if (parentId !== null) {
|
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
|
||||||
@ -1526,7 +1528,7 @@
|
|||||||
: undefined
|
: undefined
|
||||||
},
|
},
|
||||||
|
|
||||||
files: files.length > 0 ? files : undefined,
|
files: (files?.length ?? 0) > 0 ? files : undefined,
|
||||||
tool_ids: selectedToolIds.length > 0 ? selectedToolIds : undefined,
|
tool_ids: selectedToolIds.length > 0 ? selectedToolIds : undefined,
|
||||||
features: {
|
features: {
|
||||||
web_search: webSearchEnabled
|
web_search: webSearchEnabled
|
||||||
|
@ -158,6 +158,7 @@ export const AIAutocompletion = Extension.create({
|
|||||||
if (
|
if (
|
||||||
view.state.selection.$head.pos === view.state.selection.$head.end()
|
view.state.selection.$head.pos === view.state.selection.$head.end()
|
||||||
) {
|
) {
|
||||||
|
if (view.state === newState) {
|
||||||
view.dispatch(
|
view.dispatch(
|
||||||
newState.tr.setNodeMarkup(currentPos, null, {
|
newState.tr.setNodeMarkup(currentPos, null, {
|
||||||
...newNode.attrs,
|
...newNode.attrs,
|
||||||
@ -168,6 +169,7 @@ export const AIAutocompletion = Extension.create({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
loading = false;
|
loading = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user