From 3f8dbb3f36848b1d6a3a428f64733fb658fce564 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 20 Feb 2021 10:58:28 +0100 Subject: [PATCH] Update startup sequence --- assets/js/common/system.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/assets/js/common/system.js b/assets/js/common/system.js index d818e067..40e31760 100644 --- a/assets/js/common/system.js +++ b/assets/js/common/system.js @@ -34,14 +34,12 @@ const System = { Page.location_updated(e); } - /** - * Prepare login - */ + //Clean current page content Page.emptyPage(); //Show a wait splash screen - Page.showWaitSplashScreen("Starting up..."); + Page.showWaitSplashScreen(tr("Starting up...")); /** * Language initator @@ -58,13 +56,26 @@ const System = { */ ComunicWeb.components.darkTheme.refresh(); + /** + * Initialize server configuration + */ + Page.showWaitSplashScreen(tr("Loading server configuration")); + try { + ServerConfig.ensureLoaded(); + } catch(e) { + console.error(e) + Page.showTransparentWaitSplashScreen(tr("Failed to load server configuration! Please try again by refreshing the page!")); + } + /** * Get login state */ + Page.showWaitSplashScreen(tr("Refreshing login state")); await UserLogin.refreshLoginState(); // Initialize Websocket if user is connected if(signed_in()) { + Page.showWaitSplashScreen(tr("Connecting to server")); await UserWebSocket.Connect(); await UserWebSocket.WaitForConnected(); }