mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 20:19:21 +00:00
Update startup sequence
This commit is contained in:
parent
69092db808
commit
3f8dbb3f36
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user