Add updater channels.

This commit is contained in:
Patrick Fic
2025-03-31 15:20:18 -07:00
parent eeaeba2252
commit 586a076015
9 changed files with 477 additions and 73 deletions

View File

@@ -1,4 +1,6 @@
import { IpcMainEvent } from "electron";
import log from "electron-log/main";
import { autoUpdater } from "electron-updater";
import { User } from "firebase/auth";
import client from "../graphql/graphql-client";
import {
@@ -8,7 +10,6 @@ import {
QUERY_MASTERDATA_TYPED,
} from "../graphql/queries";
import Store from "../store/store";
import log from "electron-log/main";
const ipcMainHandleAuthStateChanged = async (
event: IpcMainEvent,
@@ -33,6 +34,15 @@ const ipcMainHandleAuthStateChanged = async (
Store.set("app.masterdata.opcodes", JSON.parse(OpCodes.masterdata[0]?.value));
log.debug("Received authentication state change from Renderer.", user);
log.debug("Requery shop information & master data.");
//Check for updates
const convCo = activeBodyshop.bodyshops[0].convenient_company;
if (convCo === "alpha") {
autoUpdater.channel = "alpha";
} else if (convCo === "beta") {
autoUpdater.channel = "beta";
}
autoUpdater.checkForUpdatesAndNotify();
};
export { ipcMainHandleAuthStateChanged };