Introduce Electron version (follow-up 2) (#3251)

This commit is contained in:
Alexander Zinchuk 2023-06-02 17:20:56 +02:00
parent e35c0e0399
commit 5d7b99fd3a

View File

@ -141,9 +141,15 @@ function setupAutoUpdates(window: BrowserWindow) {
});
}
autoUpdater.on('error', (error: Error) => window.webContents.send(ElectronEvent.UPDATE_ERROR, error));
autoUpdater.on('error', (error: Error) => {
if (windows.has(window)) {
window.webContents.send(ElectronEvent.UPDATE_ERROR, error);
}
});
autoUpdater.on('update-downloaded', (info: UpdateInfo) => {
window.webContents.send(ElectronEvent.UPDATE_DOWNLOADED, info);
if (windows.has(window)) {
window.webContents.send(ElectronEvent.UPDATE_DOWNLOADED, info);
}
});
}