From 7b7f680e3609b326e8124e0bc66db44a11d6c711 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 29 May 2023 20:22:00 +0300 Subject: [PATCH] added splash screen timeout... Signed-off-by: Alex A. Naanou --- Viewer/e.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Viewer/e.js b/Viewer/e.js index 7261984c..576ecb0e 100644 --- a/Viewer/e.js +++ b/Viewer/e.js @@ -54,6 +54,7 @@ global.START_GUI = false // // XXX might be nice to show load progress on splash... var SPLASH +var SPLASH_TIMEOUT = 20 * 1000 function createSplash(force=false){ // singleton window... if(!force && SPLASH){ @@ -110,6 +111,14 @@ function createSplash(force=false){ WIN && WIN.webContents.executeJavaScript('document.appSplashScreen = true') + // auto-close splash... + SPLASH_TIMEOUT + && setTimeout( + function(){ + SPLASH + && SPLASH.destroy() }, + SPLASH_TIMEOUT) + return SPLASH } @@ -238,12 +247,16 @@ ipcMain.on('exitFullScreen', // Splash screen... ipcMain.on('openSplashScreen', - function(){ SPLASH || createSplash() }) + function(){ + SPLASH + || createSplash() }) ipcMain.on('closeSplashScreen', function(){ // force this to run after this frame avoiding races... setTimeout( - function(){ SPLASH && SPLASH.destroy() }, + function(){ + SPLASH + && SPLASH.destroy() }, 10) }) // DevTools...