Skip to content

Commit abe3661

Browse files
committed
Added useEffect to reset checklist state when the workflow ID changes, ensuring accurate state management for the WorkflowChecklist component
1 parent c729bf3 commit abe3661

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

apps/dashboard/src/components/workflow-editor/workflow-checklist.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ export function WorkflowChecklist({ steps, workflow }: WorkflowChecklistProps) {
5252
const telemetry = useTelemetry();
5353
const triggerCompletedRef = useRef(false);
5454
const manuallyClosed = useRef(false);
55+
const workflowId = workflow?.workflowId;
56+
57+
useEffect(() => {
58+
if (workflowId) {
59+
triggerCompletedRef.current = false;
60+
manuallyClosed.current = false;
61+
}
62+
}, [workflowId]);
5563

5664
useEffect(() => {
5765
if (!workflow?.workflowId) return;

0 commit comments

Comments
 (0)