Files
esdp/src/main/util/checkForAppUpdates.ts
2026-02-26 12:31:24 -08:00

29 lines
692 B
TypeScript

import { autoUpdater } from "electron-updater";
import store from "../store/store";
let continuousUpdatesTriggered = false;
async function checkForAppUpdatesContinuously(): Promise<void> {
if (!continuousUpdatesTriggered) {
continuousUpdatesTriggered = true;
checkForAppUpdates();
setInterval(
() => {
checkForAppUpdates();
},
1000 * 60 * 30,
);
}
}
async function checkForAppUpdates(channel?: string | null): Promise<void> {
if (channel) {
autoUpdater.channel = channel;
//Persist to store
store.set("app.channel", channel);
}
autoUpdater.checkForUpdates();
}
export { checkForAppUpdates, checkForAppUpdatesContinuously };