checking for updates moved into app-ready

This commit is contained in:
SPRINX0\prochazka 2024-09-09 16:16:47 +02:00
parent 11e8cff77e
commit 0ea84fe034

View File

@ -206,6 +206,12 @@ ipcMain.on('app-started', async (event, arg) => {
if (autoUpdater.isUpdaterActive()) {
mainWindow.webContents.send('setAppUpdaterActive');
}
if (!process.env.DEVMODE) {
if (settingsJson['app.autoUpdateMode'] != 'skip') {
autoUpdater.autoDownload = settingsJson['app.autoUpdateMode'] == 'download';
autoUpdater.checkForUpdates();
}
}
});
ipcMain.on('window-action', async (event, arg) => {
if (!mainWindow) {
@ -485,12 +491,6 @@ autoUpdater.on('error', error => {
});
function onAppReady() {
if (!process.env.DEVMODE) {
if (settingsJson['app.autoUpdateMode'] != 'skip') {
autoUpdater.autoDownload = settingsJson['app.autoUpdateMode'] == 'download';
autoUpdater.checkForUpdates();
}
}
createWindow();
}