IO-1697 Dont display partner message unless QBD.

This commit is contained in:
Patrick Fic
2022-02-04 09:18:31 -08:00
parent 0052a54915
commit 6d3fc783d6

View File

@@ -31,15 +31,16 @@ export function PartnerPingComponent({ bodyshop, setPartnerVersion }) {
//if (process.env.NODE_ENV === "development") return;
const PartnerResponse = await axios.post("http://localhost:1337/ping/");
const { appver, qbpath } = PartnerResponse.data;
if (!bodyshop) return;
setPartnerVersion(appver);
console.log({ appver, qbpath });
if (
!qbpath &&
!(
bodyshop.cdk_dealerid ||
bodyshop.pbs_serialnumber ||
bodyshop.accountingconfig.qbo
bodyshop &&
(bodyshop.cdk_dealerid ||
bodyshop.pbs_serialnumber ||
bodyshop.accountingconfig.qbo)
)
) {
notification["error"]({
@@ -48,6 +49,7 @@ export function PartnerPingComponent({ bodyshop, setPartnerVersion }) {
});
}
} catch (error) {
console.log(error);
notification["error"]({
title: "",
message: t("general.messages.partnernotrunning"),
@@ -57,7 +59,7 @@ export function PartnerPingComponent({ bodyshop, setPartnerVersion }) {
// Execute the created function directly
checkPartnerStatus();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}, [bodyshop]);
return <></>;
}