Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: navigation bug

Brad Barbind729abc4d585
diff --git a/apps/mes/app/components/JobOperation.tsx b/apps/mes/app/components/JobOperation.tsx
index 0a94d0a4d8..c609c46a64 100644
--- a/apps/mes/app/components/JobOperation.tsx
+++ b/apps/mes/app/components/JobOperation.tsx
@@ -1241,7 +1241,10 @@ export const JobOperation = ({
<span className="text-muted-foreground text-xs">
Work Center
</span>
- <Suspense fallback={<Heading size="h4">...</Heading>}>
+ <Suspense
+ fallback={<Heading size="h4">...</Heading>}
+ key={`work-center-${operationId}`}
+ >
<Await resolve={workCenter}>
{(resolvedWorkCenter) =>
resolvedWorkCenter.data && (
@@ -1518,7 +1521,7 @@ export const JobOperation = ({
/>
)}
{completeModal.isOpen && (
- <Suspense>
+ <Suspense key={`complete-modal-${operationId}`}>
<Await resolve={materials}>
{(resolvedMaterials) => {
return (
@@ -2060,7 +2063,9 @@ function useOperation(
);
if (uncompletedEntities.length > 0) serialModal.onOpen();
setAvailableEntities(uncompletedEntities);
- }, [trackedEntities, operationId, trackedEntityParam, serialModal]);
+ // causes an infinite loop on navigation
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [trackedEntities, trackedEntityParam]);
return {
active,
@@ -3625,6 +3630,8 @@ function BatchIssueModal({
action: path.to.unconsume,
encType: "application/json",
});
+ // fetcher is not needed to be in the dependency array
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [unconsumedBatch, material?.id, parentId, trackedInputs]);
return (
diff --git a/apps/mes/app/routes/x+/operation.$operationId.tsx b/apps/mes/app/routes/x+/operation.$operationId.tsx
index 6402aaf531..db0118c9b6 100644
--- a/apps/mes/app/routes/x+/operation.$operationId.tsx
+++ b/apps/mes/app/routes/x+/operation.$operationId.tsx
@@ -149,7 +149,7 @@ export default function OperationRoute() {
return (
<JobOperation
- key={operationId}
+ key={`job-operation-${operationId}`}
events={events}
files={files}
materials={materials}