[Splash > Backend] Minor source cleanup further
This commit is contained in:
parent
516eef9abe
commit
b20b3a1566
|
@ -19,7 +19,7 @@ exports.initSplash = (startMin = false) => {
|
||||||
|
|
||||||
if (newUpdater == null) initModuleUpdater();
|
if (newUpdater == null) initModuleUpdater();
|
||||||
|
|
||||||
launchSplashWindow(startMin);
|
launchSplash(startMin);
|
||||||
|
|
||||||
if (newUpdater != null) {
|
if (newUpdater != null) {
|
||||||
updateUntilCurrent();
|
updateUntilCurrent();
|
||||||
|
@ -32,7 +32,7 @@ exports.initSplash = (startMin = false) => {
|
||||||
|
|
||||||
if (newUpdater != null) require('../utils/u2QuickLoad'); // Manually load module paths for faster requiring
|
if (newUpdater != null) require('../utils/u2QuickLoad'); // Manually load module paths for faster requiring
|
||||||
|
|
||||||
launchMainWindow();
|
launchMain();
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
events.emit('APP_SHOULD_SHOW');
|
events.emit('APP_SHOULD_SHOW');
|
||||||
|
@ -59,7 +59,7 @@ const destroySplash = () => {
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
const launchMainWindow = () => {
|
const launchMain = () => {
|
||||||
for (const e in modulesListeners) moduleUpdater.events.removeListener(e, modulesListeners[e]); // Remove updater v1 listeners
|
for (const e in modulesListeners) moduleUpdater.events.removeListener(e, modulesListeners[e]); // Remove updater v1 listeners
|
||||||
|
|
||||||
if (!launchedMainWindow && splashWindow != null) {
|
if (!launchedMainWindow && splashWindow != null) {
|
||||||
|
@ -77,7 +77,7 @@ const sendState = (status) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const launchSplashWindow = (startMin) => {
|
const launchSplash = (startMin) => {
|
||||||
splashWindow = new BrowserWindow({
|
splashWindow = new BrowserWindow({
|
||||||
width: 300,
|
width: 300,
|
||||||
height: process.platform === 'darwin' ? 300 : 350,
|
height: process.platform === 'darwin' ? 300 : 350,
|
||||||
|
@ -198,7 +198,7 @@ const updateUntilCurrent = async () => {
|
||||||
await newUpdater.startCurrentVersion();
|
await newUpdater.startCurrentVersion();
|
||||||
newUpdater.collectGarbage();
|
newUpdater.collectGarbage();
|
||||||
|
|
||||||
return launchMainWindow();
|
return launchMain();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Splash', e);
|
log('Splash', e);
|
||||||
|
@ -238,7 +238,7 @@ const initModuleUpdater = () => { // "Old" (not v2 / new, win32 only)
|
||||||
if (!succeeded) {
|
if (!succeeded) {
|
||||||
handleFail();
|
handleFail();
|
||||||
} else if (updateCount === 0) {
|
} else if (updateCount === 0) {
|
||||||
launchMainWindow();
|
launchMain();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue