Merge pull request #3874 from tylershuster/post-fix

publish: fix aggressive exit prevention
This commit is contained in:
matildepark 2020-11-03 14:10:15 -05:00 committed by GitHub
commit 7c9d12aa3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,10 +26,10 @@ interface MarkdownEditorProps {
const PromptIfDirty = () => {
const formik = useFormikContext();
usePreventWindowUnload(formik.dirty);
usePreventWindowUnload(formik.dirty && !formik.isSubmitting);
return (
<Prompt
when={formik.dirty}
when={formik.dirty && !formik.isSubmitting}
message="Are you sure you want to leave? You have unsaved changes."
/>
);