[Updater > App] Fix error for updater v2

This commit is contained in:
Ducko 2022-01-28 21:02:49 +00:00
parent 9db4c31be2
commit 36d9a091fd

View file

@ -13,16 +13,16 @@ const { initSplash, focusWindow, APP_SHOULD_LAUNCH, APP_SHOULD_SHOW, events: spl
exports.update = (startMin, done, show) => { exports.update = (startMin, done, show) => {
if (updater.tryInitUpdater(buildInfo, NEW_UPDATE_ENDPOINT)) { if (updater.tryInitUpdater(buildInfo, NEW_UPDATE_ENDPOINT)) {
const updater = updater.getUpdater(); const inst = updater.getUpdater();
updater.on('host-updated', () => { inst.on('host-updated', () => {
autostartUpdate(() => {}); autostartUpdate(() => {});
}); });
updater.on('unhandled-exception', fatal); inst.on('unhandled-exception', fatal);
updater.on(updater.INCONSISTENT_INSTALLER_STATE_ERROR, fatal); inst.on(updater.INCONSISTENT_INSTALLER_STATE_ERROR, fatal);
updater.on('update-error', handled); inst.on('update-error', handled);
performFirstRunTasks(updater); performFirstRunTasks(inst);
} else { } else {
moduleInit(UPDATE_ENDPOINT, settings, buildInfo); moduleInit(UPDATE_ENDPOINT, settings, buildInfo);
} }