diff --git a/src/components/forms/EventForm.tsx b/src/components/forms/EventForm.tsx index 3e20218..1a3756b 100644 --- a/src/components/forms/EventForm.tsx +++ b/src/components/forms/EventForm.tsx @@ -83,6 +83,17 @@ function FormWarning(props: { className?: string; title?: string; children: stri ); } +const checkIfSubmitted = (callback: any) => { + const [called, setCalled] = useState(false); + + return (e: any) => { + if (!called) { + setCalled(true); + callback(e); + } + } +} + const EventForm: FunctionComponent = ({ context, onSubmit, @@ -175,7 +186,7 @@ const EventForm: FunctionComponent = ({ }, [watchedEventTiming]); return ( -
+