From d50072ad4398150c8ecef9ab425b5028c703bda7 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Fri, 27 Sep 2024 15:26:19 +0800 Subject: [PATCH 1/2] Reverting the validation step when a patrol task form is rendered, which fixes 1012 Signed-off-by: Aaron Chong --- packages/react-components/lib/tasks/types/patrol.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-components/lib/tasks/types/patrol.tsx b/packages/react-components/lib/tasks/types/patrol.tsx index 5fa3ea4d5..f84feb76e 100644 --- a/packages/react-components/lib/tasks/types/patrol.tsx +++ b/packages/react-components/lib/tasks/types/patrol.tsx @@ -125,6 +125,10 @@ export function PatrolTaskForm({ onChange(desc); }; + React.useEffect(() => { + onValidate(isPatrolTaskDescriptionValid(taskDesc)); + }, [taskDesc]); + return ( From 7f95f2b9173c49ac395dafdac36242e401f7b711 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Fri, 27 Sep 2024 16:55:02 +0800 Subject: [PATCH 2/2] Lint Signed-off-by: Aaron Chong --- packages/react-components/lib/tasks/types/patrol.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-components/lib/tasks/types/patrol.tsx b/packages/react-components/lib/tasks/types/patrol.tsx index f84feb76e..707dff5e4 100644 --- a/packages/react-components/lib/tasks/types/patrol.tsx +++ b/packages/react-components/lib/tasks/types/patrol.tsx @@ -127,7 +127,7 @@ export function PatrolTaskForm({ React.useEffect(() => { onValidate(isPatrolTaskDescriptionValid(taskDesc)); - }, [taskDesc]); + }, [onValidate, taskDesc]); return (