From 7a3263f57b53857290d6918d4e9a3e14615e3e46 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 19 Apr 2020 12:15:10 -0700 Subject: [PATCH] Fix start server tasking; closes #1928 --- .../server/schedules/TaskDetailsModal.tsx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/resources/scripts/components/server/schedules/TaskDetailsModal.tsx b/resources/scripts/components/server/schedules/TaskDetailsModal.tsx index 9bcc00c14..53481a144 100644 --- a/resources/scripts/components/server/schedules/TaskDetailsModal.tsx +++ b/resources/scripts/components/server/schedules/TaskDetailsModal.tsx @@ -10,6 +10,7 @@ import FlashMessageRender from '@/components/FlashMessageRender'; import { number, object, string } from 'yup'; import useFlash from '@/plugins/useFlash'; import useServer from '@/plugins/useServer'; +import FormikFieldWrapper from '@/components/elements/FormikFieldWrapper'; interface Props { schedule: Schedule; @@ -29,10 +30,8 @@ const TaskDetailsForm = ({ isEditingTask }: { isEditingTask: boolean }) => { const { values: { action }, setFieldValue, setFieldTouched } = useFormikContext(); useEffect(() => { - return () => { - setFieldValue('payload', ''); - setFieldTouched('payload', false); - }; + setFieldValue('payload', action === 'power' ? 'start' : ''); + setFieldTouched('payload', false); }, [ action ]); return ( @@ -56,12 +55,14 @@ const TaskDetailsForm = ({ isEditingTask }: { isEditingTask: boolean }) => { :
- - - - - - + + + + + + + +
}