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