diff --git a/src/interface/desktop/chat.html b/src/interface/desktop/chat.html index 92554e13..627ce3de 100644 --- a/src/interface/desktop/chat.html +++ b/src/interface/desktop/chat.html @@ -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: