[Splash] Start quick start and skip startup update checks
This commit is contained in:
parent
7f78bc8d9a
commit
1f1736bcc3
2 changed files with 32 additions and 2 deletions
1
src/bootstrap.js
vendored
1
src/bootstrap.js
vendored
|
@ -41,6 +41,7 @@ const startUpdate = () => {
|
||||||
appUpdater.update(false, () => {
|
appUpdater.update(false, () => {
|
||||||
startCore();
|
startCore();
|
||||||
}, () => {
|
}, () => {
|
||||||
|
log('Bootstrap', 'Setting main window visible');
|
||||||
desktopCore.setMainWindowVisible(true);
|
desktopCore.setMainWindowVisible(true);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -192,6 +192,18 @@ async function updateUntilCurrent() {
|
||||||
}
|
}
|
||||||
/* eslint-enable camelcase */
|
/* eslint-enable camelcase */
|
||||||
|
|
||||||
|
const oldCheckForUpdates = () => {
|
||||||
|
if (oaConfig.skipStartupUpdateChecks !== true) {
|
||||||
|
moduleUpdater.checkForUpdates();
|
||||||
|
} else {
|
||||||
|
log('Splash', 'Skipping startup update checking (enabled)');
|
||||||
|
|
||||||
|
modulesListeners[UPDATE_CHECK_FINISHED]({
|
||||||
|
succeeded: true,
|
||||||
|
updateCount: 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function initOldUpdater() {
|
function initOldUpdater() {
|
||||||
modulesListeners = {};
|
modulesListeners = {};
|
||||||
|
@ -263,7 +275,7 @@ function initOldUpdater() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
addModulesListener(NO_PENDING_UPDATES, () => moduleUpdater.checkForUpdates());
|
addModulesListener(NO_PENDING_UPDATES, () => oldCheckForUpdates());
|
||||||
addModulesListener(INSTALLING_MODULE, ({
|
addModulesListener(INSTALLING_MODULE, ({
|
||||||
name,
|
name,
|
||||||
current,
|
current,
|
||||||
|
@ -291,7 +303,7 @@ function initOldUpdater() {
|
||||||
addModulesListener(INSTALLING_MODULES_FINISHED, ({
|
addModulesListener(INSTALLING_MODULES_FINISHED, ({
|
||||||
succeeded,
|
succeeded,
|
||||||
failed
|
failed
|
||||||
}) => moduleUpdater.checkForUpdates());
|
}) => oldCheckForUpdates());
|
||||||
addModulesListener(UPDATE_MANUALLY, ({
|
addModulesListener(UPDATE_MANUALLY, ({
|
||||||
newVersion
|
newVersion
|
||||||
}) => {
|
}) => {
|
||||||
|
@ -316,6 +328,23 @@ function initSplash(startMinimized = false) {
|
||||||
quoteCachePath = _path.default.join(paths.getUserData(), 'quotes.json');
|
quoteCachePath = _path.default.join(paths.getUserData(), 'quotes.json');
|
||||||
|
|
||||||
_ipcMain.default.on('UPDATED_QUOTES', (_event, quotes) => cacheLatestQuotes(quotes));
|
_ipcMain.default.on('UPDATED_QUOTES', (_event, quotes) => cacheLatestQuotes(quotes));
|
||||||
|
|
||||||
|
if (process.env.OPENASAR_QUICKSTART) setTimeout(() => {
|
||||||
|
destroySplash();
|
||||||
|
|
||||||
|
if (newUpdater != null) {
|
||||||
|
updateUntilCurrent();
|
||||||
|
} else {
|
||||||
|
// moduleUpdater.installPendingUpdates();
|
||||||
|
moduleUpdater.setInBackground();
|
||||||
|
}
|
||||||
|
|
||||||
|
launchMainWindow();
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
events.emit(APP_SHOULD_SHOW);
|
||||||
|
}, 100);
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
function destroySplash() {
|
function destroySplash() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue