2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/main/registerAutoUpdaterListeners.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
494 B
TypeScript
Raw Normal View History

2022-05-27 10:47:24 +00:00
import { autoUpdater } from 'electron-updater';
import { Main } from '../main';
2022-03-31 07:33:58 +00:00
import { IPC_CHANNELS } from '../utils/messages';
export default function registerAutoUpdaterListeners(main: Main) {
2022-05-27 10:47:24 +00:00
autoUpdater.autoDownload = true;
autoUpdater.autoInstallOnAppQuit = true;
autoUpdater.on('error', (error) => {
if (!main.checkedForUpdate) {
main.checkedForUpdate = true;
return;
}
2022-05-27 10:47:24 +00:00
main.mainWindow!.webContents.send(IPC_CHANNELS.MAIN_PROCESS_ERROR, error);
});
}