Remove chat loading animation in login required state on Desktop app

This commit is contained in:
Debanjum Singh Solanky 2024-04-12 11:50:02 +05:30
parent b3f4794d91
commit 50b4788a91

View file

@ -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>