mirror of
https://github.com/open-webui/open-webui
synced 2025-01-19 09:16:44 +00:00
refac
This commit is contained in:
parent
85038cef69
commit
c8cdc6377b
@ -22,10 +22,16 @@
|
||||
let typingUsers = [];
|
||||
let typingUsersTimeout = {};
|
||||
|
||||
let messagesContainerElement = null;
|
||||
|
||||
$: if (threadId) {
|
||||
initHandler();
|
||||
}
|
||||
|
||||
const scrollToBottom = () => {
|
||||
messagesContainerElement.scrollTop = messagesContainerElement.scrollHeight;
|
||||
};
|
||||
|
||||
const initHandler = async () => {
|
||||
messages = null;
|
||||
top = false;
|
||||
@ -39,6 +45,9 @@
|
||||
if (messages.length < 50) {
|
||||
top = true;
|
||||
}
|
||||
|
||||
await tick();
|
||||
scrollToBottom();
|
||||
} else {
|
||||
goto('/');
|
||||
}
|
||||
@ -152,7 +161,7 @@
|
||||
</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
|
||||
id={threadId}
|
||||
{channel}
|
||||
|
Loading…
Reference in New Issue
Block a user