IO-3358 Resolve update channel & null claim number.
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user