mirror of
https://github.com/open-webui/open-webui
synced 2025-02-07 13:34:55 +00:00
refac
This commit is contained in:
parent
85038cef69
commit
c8cdc6377b
@ -22,10 +22,16 @@
|
|||||||
let typingUsers = [];
|
let typingUsers = [];
|
||||||
let typingUsersTimeout = {};
|
let typingUsersTimeout = {};
|
||||||
|
|
||||||
|
let messagesContainerElement = null;
|
||||||
|
|
||||||
$: if (threadId) {
|
$: if (threadId) {
|
||||||
initHandler();
|
initHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const scrollToBottom = () => {
|
||||||
|
messagesContainerElement.scrollTop = messagesContainerElement.scrollHeight;
|
||||||
|
};
|
||||||
|
|
||||||
const initHandler = async () => {
|
const initHandler = async () => {
|
||||||
messages = null;
|
messages = null;
|
||||||
top = false;
|
top = false;
|
||||||
@ -39,6 +45,9 @@
|
|||||||
if (messages.length < 50) {
|
if (messages.length < 50) {
|
||||||
top = true;
|
top = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await tick();
|
||||||
|
scrollToBottom();
|
||||||
} else {
|
} else {
|
||||||
goto('/');
|
goto('/');
|
||||||
}
|
}
|
||||||
@ -152,7 +161,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class=" max-h-full w-full overflow-y-auto">
|
<div class=" max-h-full w-full overflow-y-auto" bind:this={messagesContainerElement}>
|
||||||
<Messages
|
<Messages
|
||||||
id={threadId}
|
id={threadId}
|
||||||
{channel}
|
{channel}
|
||||||
|
Loading…
Reference in New Issue
Block a user