2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 14:50:56 +00:00

fix(ux): don't notify if no updates on startup

This commit is contained in:
18alantom 2022-02-08 12:56:46 +05:30
parent 325045dc34
commit b725267789

View File

@ -215,7 +215,6 @@ ipcMain.handle(IPC_ACTIONS.SEND_ERROR, (event, bodyJson) => {
ipcMain.handle(IPC_ACTIONS.CHECK_FOR_UPDATES, (event, force) => {
if (!isDevelopment && !checkedForUpdate) {
autoUpdater.checkForUpdates();
checkedForUpdate = true;
} else if (force) {
autoUpdater.checkForUpdates();
}
@ -236,10 +235,17 @@ autoUpdater.on('checking-for-update', () => {
});
autoUpdater.on('update-available', (info) => {
if (!checkedForUpdate) {
checkedForUpdate = true;
}
mainWindow.webContents.send(IPC_CHANNELS.UPDATE_AVAILABLE, info.version);
});
autoUpdater.on('update-not-available', () => {
if (!checkedForUpdate) {
checkedForUpdate = true;
return;
}
mainWindow.webContents.send(IPC_CHANNELS.UPDATE_NOT_AVAILABLE);
});
@ -248,6 +254,10 @@ autoUpdater.on('update-downloaded', () => {
});
autoUpdater.on('error', (error) => {
if (!checkedForUpdate) {
checkedForUpdate = true;
return;
}
mainWindow.webContents.send(IPC_CHANNELS.UPDATE_ERROR, error);
});