From c58348735d85c0be774a44a77eece89307492a0d Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 1 Aug 2020 19:49:38 -0700 Subject: [PATCH] Avoid double-click double-submit issues in modals; closes #2199 --- .../components/server/backups/CreateBackupButton.tsx | 8 ++------ .../components/server/schedules/EditScheduleModal.tsx | 2 +- .../components/server/schedules/TaskDetailsModal.tsx | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/resources/scripts/components/server/backups/CreateBackupButton.tsx b/resources/scripts/components/server/backups/CreateBackupButton.tsx index 7a04f1041..3d7834fa9 100644 --- a/resources/scripts/components/server/backups/CreateBackupButton.tsx +++ b/resources/scripts/components/server/backups/CreateBackupButton.tsx @@ -49,7 +49,7 @@ const ModalContent = ({ ...props }: RequiredModalProps) => {
-
@@ -94,11 +94,7 @@ export default () => { ignored: string(), })} > - setVisible(false)} - /> + setVisible(false)}/> } diff --git a/resources/scripts/components/server/schedules/TaskDetailsModal.tsx b/resources/scripts/components/server/schedules/TaskDetailsModal.tsx index 3829d724d..b8b102ba0 100644 --- a/resources/scripts/components/server/schedules/TaskDetailsModal.tsx +++ b/resources/scripts/components/server/schedules/TaskDetailsModal.tsx @@ -32,7 +32,7 @@ interface Values { } const TaskDetailsForm = ({ isEditingTask }: { isEditingTask: boolean }) => { - const { values: { action }, setFieldValue, setFieldTouched } = useFormikContext(); + const { values: { action }, setFieldValue, setFieldTouched, isSubmitting } = useFormikContext(); useEffect(() => { setFieldValue('payload', action === 'power' ? 'start' : ''); @@ -94,7 +94,7 @@ const TaskDetailsForm = ({ isEditingTask }: { isEditingTask: boolean }) => { />
-