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", "name": "bodyshop-desktop",
"version": "1.0.4", "version": "1.0.5-alpha.1",
"description": "Shop Management System Partner", "description": "Shop Management System Partner",
"main": "./out/main/index.js", "main": "./out/main/index.js",
"author": "Convenient Brands, LLC", "author": "Convenient Brands, LLC",

View File

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

View File

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

View File

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

View File

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