Add better update handler.
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
SettingsWatchedFilePathsRemove,
|
||||
} from "./ipcMainHandler.settings";
|
||||
import { ipcMainHandleAuthStateChanged } from "./ipcMainHandler.user";
|
||||
import { autoUpdater } from "electron-updater";
|
||||
|
||||
// Log all IPC messages and their payloads
|
||||
const logIpcMessages = (): void => {
|
||||
@@ -87,4 +88,19 @@ ipcMain.on(ipcTypes.toMain.watcher.stop, () => {
|
||||
StopWatcher();
|
||||
});
|
||||
|
||||
ipcMain.on(ipcTypes.toMain.updates.download, () => {
|
||||
log.info("Download update requested from renderer.");
|
||||
autoUpdater.downloadUpdate();
|
||||
});
|
||||
|
||||
ipcMain.on(ipcTypes.toMain.updates.checkForUpdates, () => {
|
||||
log.info("Checking for updates from renderer.");
|
||||
autoUpdater.checkForUpdates();
|
||||
});
|
||||
|
||||
ipcMain.on(ipcTypes.toMain.updates.apply, () => {
|
||||
log.info("Applying update from renderer.");
|
||||
autoUpdater.quitAndInstall();
|
||||
});
|
||||
|
||||
logIpcMessages();
|
||||
|
||||
Reference in New Issue
Block a user