mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
18 lines
494 B
TypeScript
18 lines
494 B
TypeScript
import { autoUpdater } from 'electron-updater';
|
|
import { Main } from '../main';
|
|
import { IPC_CHANNELS } from '../utils/messages';
|
|
|
|
export default function registerAutoUpdaterListeners(main: Main) {
|
|
autoUpdater.autoDownload = true;
|
|
autoUpdater.autoInstallOnAppQuit = true;
|
|
|
|
autoUpdater.on('error', (error) => {
|
|
if (!main.checkedForUpdate) {
|
|
main.checkedForUpdate = true;
|
|
return;
|
|
}
|
|
|
|
main.mainWindow!.webContents.send(IPC_CHANNELS.MAIN_PROCESS_ERROR, error);
|
|
});
|
|
}
|