IO-3358 Resolve update channel & null claim number.

This commit is contained in:
Patrick Fic
2025-09-08 10:30:53 -07:00
parent d5b40ef6f4
commit 9fdd88526c
5 changed files with 28 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "bodyshop-desktop",
"version": "1.0.4",
"version": "1.0.5-alpha.1",
"description": "Shop Management System Partner",
"main": "./out/main/index.js",
"author": "Convenient Brands, LLC",

View File

@@ -182,7 +182,9 @@ const DecodeAD1 = async (
if (!rawAd1Data.ownr_ph1 || _.isEmpty(rawAd1Data.ownr_ph1)) {
rawAd1Data.ownr_ph1 = rawAd1Data.ownr_ph2;
}
if (rawAd1Data.clm_no === "") {
rawAd1Data.clm_no = undefined;
}
let ownerRecord: OwnerRecordInterface;
//Check if the owner information is there. If not, use the insured information as a fallback.
if (

View File

@@ -157,14 +157,16 @@ async function ImportJob(filepath: string): Promise<void> {
console.log("Available Job record to upload;", newAvailableJob);
setAppProgressbar(0.95);
const existingJobRecord: QueryJobByClmNoResult = await client.request(
QUERY_JOB_BY_CLM_NO_TYPED,
{ clm_no: jobObject.clm_no },
);
if (jobObject.clm_no) {
const existingJobRecord: QueryJobByClmNoResult = await client.request(
QUERY_JOB_BY_CLM_NO_TYPED,
{ clm_no: jobObject.clm_no },
);
if (existingJobRecord.jobs.length > 0) {
newAvailableJob.issupplement = true;
newAvailableJob.jobid = existingJobRecord.jobs[0].id;
if (existingJobRecord.jobs.length > 0) {
newAvailableJob.issupplement = true;
newAvailableJob.jobid = existingJobRecord.jobs[0].id;
}
}
const insertRecordResult: InsertAvailableJobResult = await client.request(

View File

@@ -20,10 +20,15 @@ const ipcMainHandleAuthStateChanged = async (
user: User | null,
): Promise<void> => {
Store.set("user", user);
log.debug("Received authentication state change from Renderer.", user);
await setReleaseChannel();
checkForAppUpdatesContinuously();
};
async function setReleaseChannel() {
try {
//Need to query the currently active shop, and store the metadata as well.
//Also need to query the OP Codes for decoding reference.
log.debug("Received authentication state change from Renderer.", user);
await handleShopMetaDataFetch();
//Check for updates
const bodyshop = Store.get("app.bodyshop");
@@ -33,6 +38,8 @@ const ipcMainHandleAuthStateChanged = async (
} else if (bodyshop?.convenient_company?.toLowerCase() === "beta") {
autoUpdater.channel = "beta";
log.debug("Setting update channel to BETA channel.");
} else {
log.debug("Setting update channel to LATEST channel.");
}
} catch (error) {
log.error(
@@ -44,8 +51,7 @@ const ipcMainHandleAuthStateChanged = async (
"Error connecting to ImEX Online servers to get shop data. Please try again.",
);
}
checkForAppUpdatesContinuously();
};
}
const handleShopMetaDataFetch = async (
reloadWindow?: boolean,
@@ -89,7 +95,8 @@ const ipMainHandleResetPassword = async (): Promise<void> => {
};
export {
handleShopMetaDataFetch,
ipcMainHandleAuthStateChanged,
ipMainHandleResetPassword,
handleShopMetaDataFetch,
setReleaseChannel,
};

View File

@@ -1,6 +1,8 @@
import { autoUpdater } from "electron-updater";
import { setReleaseChannel } from "../ipc/ipcMainHandler.user";
function checkForAppUpdatesContinuously(): void {
async function checkForAppUpdatesContinuously(): Promise<void> {
await setReleaseChannel();
checkForAppUpdates();
setInterval(
() => {
@@ -16,4 +18,4 @@ function checkForAppUpdates(): void {
});
}
export { checkForAppUpdatesContinuously, checkForAppUpdates };
export { checkForAppUpdates, checkForAppUpdatesContinuously };