Skip to content

Commit

Permalink
fix: edit autoUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
UrijHoruzij committed Jan 13, 2023
1 parent 278b563 commit d478bd5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main/helpers/autoUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ const { ipcMain } = require('electron');

const autoUpdate = (mainWindow) => {
ipcMain.on('check-update', () => {
mainWindow.webContents.send('update-status', 'checking-for-update');
mainWindow.webContents.send('update-status', { status: 'checking-for-update' });
autoUpdater.checkForUpdatesAndNotify();
});
autoUpdater.on('checking-for-update', () => {
mainWindow.webContents.send('update-status', 'checking-for-update');
mainWindow.webContents.send('update-status', { status: 'checking-for-update' });
});
autoUpdater.on('update-available', () => {
mainWindow.webContents.send('update-status', 'update-available');
mainWindow.webContents.send('update-status', { status: 'update-available' });
});
autoUpdater.on('update-not-available', () => {
mainWindow.webContents.send('update-status', 'update-not-available');
mainWindow.webContents.send('update-status', { status: 'update-not-available' });
});
autoUpdater.on('update-downloaded', () => {
mainWindow.webContents.send('update-status', 'update-downloaded');
mainWindow.webContents.send('update-status', { status: 'update-downloaded' });
});
autoUpdater.on('error', () => {
mainWindow.webContents.send('update-status', 'error');
mainWindow.webContents.send('update-status', { status: 'error' });
});
autoUpdater.on('download-progress', ({ bytesPerSecond, percent, total }) => {
mainWindow.webContents.send('update-status', 'download-progress', bytesPerSecond, percent, total);
mainWindow.webContents.send('update-status', { status: 'download-progress', bytesPerSecond, percent, total });
});
ipcMain.on('update', () => {
autoUpdater.quitAndInstall();
Expand Down

0 comments on commit d478bd5

Please sign in to comment.