mirror of
https://github.com/open-webui/computer.git
synced 2026-11-22 21:50:43 -05:00
refac
This commit is contained in:
1 parent
d21a3bcf86
commit
cfc99b228b
1 file changed
+5
-2
@@ -181,13 +181,16 @@
|
||||
|
||||
async function loadChat(id: string) {
|
||||
chatId = id;
|
||||
loading = true;
|
||||
// Only show loading spinner on initial load (no messages yet).
|
||||
// On reloads (e.g. after cancel), keep the DOM intact to preserve scroll position.
|
||||
const isInitialLoad = allMessages.length === 0;
|
||||
if (isInitialLoad) loading = true;
|
||||
try {
|
||||
const data = await getChat(id);
|
||||
allMessages = data.messages;
|
||||
currentMessageId = data.chat.current_message_id;
|
||||
} finally {
|
||||
loading = false;
|
||||
if (isInitialLoad) loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user