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