From 4ae0e48e98837a2a17cdda1a153b604d9f3ac4ad Mon Sep 17 00:00:00 2001 From: Oj Date: Fri, 10 Dec 2021 18:03:44 +0000 Subject: [PATCH] [Splash > QuickStart] New updater force init v2 --- src/splash/splashScreen.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/splash/splashScreen.js b/src/splash/splashScreen.js index 7506fbb..fb2ab39 100644 --- a/src/splash/splashScreen.js +++ b/src/splash/splashScreen.js @@ -332,6 +332,18 @@ function initSplash(startMinimized = false) { if (process.env.OPENASAR_QUICKSTART || oaConfig.quickstart) setTimeout(() => { destroySplash(); + if (newUpdater !== null) { // Manually load desktop_core module path for faster requiring + const NodeModule = require('module'); + + const installDir = paths.getInstallPath(); + const appDir = _fs.default.readdirSync(installDir).find((x) => x.startsWith('app-1')); // Find app dir by name + + const modulesDir = _path.default.join(installDir, appDir, 'modules'); + + const moduleCoreDir = _fs.default.readdirSync(modulesDir).find((x) => x.startsWith('discord_desktop_core-')); // Find desktop core dir by name + NodeModule.globalPaths.push(_path.default.join(modulesDir, moduleCoreDir)); // Add to globalPaths for requiring + } + if (newUpdater != null) { updateUntilCurrent(); } else { @@ -344,7 +356,7 @@ function initSplash(startMinimized = false) { setTimeout(() => { events.emit(APP_SHOULD_SHOW); }, 100); - }, newUpdater != null ? 500 : 50); + }, 50); } function destroySplash() {