mirror of
https://github.com/open-webui/open-webui
synced 2024-11-07 00:59:52 +00:00
fix
This commit is contained in:
parent
a860e98ab9
commit
3dd1d1bc4a
@ -2071,33 +2071,9 @@
|
||||
{createMessagePair}
|
||||
on:submit={async (e) => {
|
||||
if (e.detail) {
|
||||
// New user message
|
||||
let userPrompt = e.detail.prompt;
|
||||
let userMessageId = uuidv4();
|
||||
|
||||
let userMessage = {
|
||||
id: userMessageId,
|
||||
parentId: e.detail.parentId,
|
||||
childrenIds: [],
|
||||
role: 'user',
|
||||
content: userPrompt,
|
||||
models: selectedModels
|
||||
};
|
||||
|
||||
let messageParentId = e.detail.parentId;
|
||||
|
||||
if (messageParentId !== null) {
|
||||
history.messages[messageParentId].childrenIds = [
|
||||
...history.messages[messageParentId].childrenIds,
|
||||
userMessageId
|
||||
];
|
||||
}
|
||||
|
||||
history.messages[userMessageId] = userMessage;
|
||||
history.currentId = userMessageId;
|
||||
|
||||
prompt = '';
|
||||
await tick();
|
||||
await sendPrompt(userPrompt, userMessageId);
|
||||
submitPrompt(e.detail);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user