mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-15 09:31:21 +00:00
refac
This commit is contained in:
parent
55944a0e0e
commit
d14d8788af
1 changed files with 10 additions and 1 deletions
|
|
@ -96,9 +96,18 @@
|
|||
const type = event?.data?.type ?? null;
|
||||
const data = event?.data?.data ?? null;
|
||||
|
||||
if (
|
||||
messages === null &&
|
||||
type !== 'typing' &&
|
||||
(data?.parent_id === threadId || (data?.id === threadId && type !== 'message:delete'))
|
||||
) {
|
||||
// Restart the fetch; loadVersion prevents its stale response from being applied.
|
||||
return initHandler(searchAnchor);
|
||||
}
|
||||
|
||||
if (type === 'message') {
|
||||
if ((data?.parent_id ?? null) === threadId) {
|
||||
if (messages) {
|
||||
if (messages && !messages.some((message) => message.id === data.id)) {
|
||||
messages = [{ ...data, temp_id: null }, ...messages];
|
||||
|
||||
if (typingUsers.find((user) => user.id === event.user.id)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue