mirror of
https://github.com/open-webui/open-webui
synced 2025-01-31 15:01:00 +00:00
refac
This commit is contained in:
parent
f7ecfafe1a
commit
96b1c2024b
@ -35,7 +35,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const scrollToBottom = () => {
|
const scrollToBottom = () => {
|
||||||
messagesContainerElement.scrollTop = messagesContainerElement.scrollHeight;
|
if (messagesContainerElement) {
|
||||||
|
messagesContainerElement.scrollTop = messagesContainerElement.scrollHeight;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const initHandler = async () => {
|
const initHandler = async () => {
|
||||||
@ -55,7 +57,7 @@
|
|||||||
messages = await getChannelMessages(localStorage.token, id, 0);
|
messages = await getChannelMessages(localStorage.token, id, 0);
|
||||||
|
|
||||||
if (messages) {
|
if (messages) {
|
||||||
messagesContainerElement.scrollTop = messagesContainerElement.scrollHeight;
|
scrollToBottom();
|
||||||
|
|
||||||
if (messages.length < 50) {
|
if (messages.length < 50) {
|
||||||
top = true;
|
top = true;
|
||||||
@ -81,7 +83,7 @@
|
|||||||
|
|
||||||
await tick();
|
await tick();
|
||||||
if (scrollEnd) {
|
if (scrollEnd) {
|
||||||
messagesContainerElement.scrollTop = messagesContainerElement.scrollHeight;
|
scrollToBottom();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (type === 'message:update') {
|
} else if (type === 'message:update') {
|
||||||
|
Loading…
Reference in New Issue
Block a user