diff --git a/src/interface/desktop/chat.html b/src/interface/desktop/chat.html
index b7d67eac..521d2e0c 100644
--- a/src/interface/desktop/chat.html
+++ b/src/interface/desktop/chat.html
@@ -672,6 +672,13 @@
chatHistoryUrl += `&conversation_id=${chatBody.dataset.conversationId}`;
}
+ // Create loading screen and add it to chat-body
+ let loadingScreen = document.createElement('div');
+ loadingScreen.classList.add("loading-spinner");
+ let yellowOrb = document.createElement('div');
+ loadingScreen.appendChild(yellowOrb);
+ chatBody.appendChild(loadingScreen);
+
fetch(`${hostURL}${chatHistoryUrl}`, { headers })
.then(response => response.json())
.then(data => {
@@ -705,11 +712,17 @@
chat_log.intent?.type,
chat_log.intent?.["inferred-queries"]);
}
+ loadingScreen.style.height = chatBody.scrollHeight + 'px';
})
+
+ // Add fade out animation to loading screen and remove it after the animation ends
let chatBodyWrapper = document.getElementById("chat-body-wrapper");
chatBodyWrapperHeight = chatBodyWrapper.clientHeight;
-
chatBody.style.height = chatBodyWrapperHeight;
+ setTimeout(() => {
+ loadingScreen.remove();
+ chatBody.classList.remove("relative-position");
+ }, 500);
})
.catch(err => {
// If the server returns a 500 error with detail, render a setup hint.
@@ -1100,9 +1113,10 @@
-