mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 09:25:06 +01:00
Remove chat loading animation in login required state on Desktop app
This commit is contained in:
parent
b3f4794d91
commit
50b4788a91
1 changed files with 16 additions and 9 deletions
|
@ -720,19 +720,15 @@
|
|||
})
|
||||
|
||||
// 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);
|
||||
fadeOutLoadingAnimation(loadingScreen);
|
||||
})
|
||||
.catch(err => {
|
||||
// If the server returns a 500 error with detail, render a setup hint.
|
||||
if (!firstRunSetupMessageRendered)
|
||||
if (!firstRunSetupMessageRendered) {
|
||||
renderFirstRunSetupMessage();
|
||||
return;
|
||||
fadeOutLoadingAnimation(loadingScreen);
|
||||
}
|
||||
return;
|
||||
});
|
||||
|
||||
await refreshChatSessionsPanel();
|
||||
|
@ -782,6 +778,17 @@
|
|||
}
|
||||
}
|
||||
|
||||
function fadeOutLoadingAnimation(loadingScreen) {
|
||||
let chatBody = document.getElementById("chat-body");
|
||||
let chatBodyWrapper = document.getElementById("chat-body-wrapper");
|
||||
chatBodyWrapperHeight = chatBodyWrapper.clientHeight;
|
||||
chatBody.style.height = chatBodyWrapperHeight;
|
||||
setTimeout(() => {
|
||||
loadingScreen.remove();
|
||||
chatBody.classList.remove("relative-position");
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function renderFirstRunSetupMessage() {
|
||||
first_run_message = `Hi 👋🏾, to get started:
|
||||
<ol>
|
||||
|
|
Loading…
Reference in a new issue