fix: (#79) enable setSubmitting flag before response dom update

This commit is contained in:
abhijithvijayan
2020-02-09 10:03:59 +05:30
parent 2c801b9cde
commit 66ad7e5dc2

View File

@@ -118,6 +118,9 @@ const PopupForm = withFormik<PopupFormProperties, PopupFormValuesProperties>({
apiBody
);
// enable submit button
setSubmitting(false);
if (!response.error) {
const {
data: { link },
@@ -129,9 +132,6 @@ const PopupForm = withFormik<PopupFormProperties, PopupFormValuesProperties>({
// errored
setRequestProcessed({ error: true, message: response.message });
}
// enable submit button
setSubmitting(false);
},
displayName: 'PopupForm',