diff --git a/client/src/components/dms-allocations-summary-ap/dms-allocations-summary-ap.component.jsx b/client/src/components/dms-allocations-summary-ap/dms-allocations-summary-ap.component.jsx
index abbde7277..0125191dd 100644
--- a/client/src/components/dms-allocations-summary-ap/dms-allocations-summary-ap.component.jsx
+++ b/client/src/components/dms-allocations-summary-ap/dms-allocations-summary-ap.component.jsx
@@ -20,7 +20,7 @@ export function DmsAllocationsSummaryAp({ bodyshop, billids, title }) {
const { socket } = useContext(SocketContext);
useEffect(() => {
- if (!socket) return;
+ if (!socket || !socket.connected) return;
const handleSuccess = async (billid) => {
setAllocationsSummary((allocationsSummary) =>
@@ -45,21 +45,10 @@ export function DmsAllocationsSummaryAp({ bodyshop, billids, title }) {
}
};
- const handleFailure = ({ billid, error }) => {
- setAllocationsSummary((allocationsSummary) =>
- allocationsSummary.map((a) => {
- if (a.billid !== billid) return a;
- return { ...a, status: error };
- })
- );
- };
-
socket.on("ap-export-success", handleSuccess);
- socket.on("ap-export-failure", handleFailure);
return () => {
socket.off("ap-export-success", handleSuccess);
- socket.off("ap-export-failure", handleFailure);
};
}, [socket]);
diff --git a/client/src/components/dms-allocations-summary/dms-allocations-summary.component.jsx b/client/src/components/dms-allocations-summary/dms-allocations-summary.component.jsx
index 3551cc6e3..cbc2680dd 100644
--- a/client/src/components/dms-allocations-summary/dms-allocations-summary.component.jsx
+++ b/client/src/components/dms-allocations-summary/dms-allocations-summary.component.jsx
@@ -24,7 +24,7 @@ export function DmsAllocationsSummary({ socket, bodyshop, jobId, title }) {
const [allocationsSummary, setAllocationsSummary] = useState([]);
useEffect(() => {
- if (socket.connected) {
+ if (socket && socket.connected) {
socket.emit("cdk-calculate-allocations", jobId, (ack) => {
setAllocationsSummary(ack);
socket.allocationsSummary = ack;
diff --git a/client/src/pages/dms-payables/dms-payables.container.jsx b/client/src/pages/dms-payables/dms-payables.container.jsx
index 15117c94d..c354687fb 100644
--- a/client/src/pages/dms-payables/dms-payables.container.jsx
+++ b/client/src/pages/dms-payables/dms-payables.container.jsx
@@ -60,7 +60,7 @@ export function DmsContainer({ setBreadcrumbs, setSelectedHeader }) {
{
timestamp: new Date(),
level: "WARNING",
- message: "Reconnected to CDK Export Service"
+ message: "Reconnected to DMS Export Service"
}
]);
};
diff --git a/client/src/pages/dms/dms.container.jsx b/client/src/pages/dms/dms.container.jsx
index ab1d40f95..1328595cc 100644
--- a/client/src/pages/dms/dms.container.jsx
+++ b/client/src/pages/dms/dms.container.jsx
@@ -90,7 +90,7 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader, inse
{
timestamp: new Date(),
level: "WARNING",
- message: "Reconnected to CDK Export Service"
+ message: "Reconnected to DMS Export Service"
}
]);
};
@@ -201,7 +201,7 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader, inse
WARNING
ERROR
- 4
+