mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
refac
This commit is contained in:
parent
85038cef69
commit
c8cdc6377b
1 changed files with 10 additions and 1 deletions
|
|
@ -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 a new issue