From ae4dc79d36ddd760e3809828734453611d68cd5c Mon Sep 17 00:00:00 2001 From: Hel Nershing Thapa Date: Sun, 24 Jul 2022 16:24:56 +0545 Subject: [PATCH] Add loading indicator while the form is being saved --- .../src/components/user/forms/personalInformation.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/user/forms/personalInformation.js b/frontend/src/components/user/forms/personalInformation.js index 02ee7b5172..b6b4f3fc56 100644 --- a/frontend/src/components/user/forms/personalInformation.js +++ b/frontend/src/components/user/forms/personalInformation.js @@ -62,15 +62,18 @@ function _PersonalInformationForm(props) { ) : undefined; + async function handleFormSubmit(values) { + await props.pushUserDetails(prepareUserDetailsToPush(values, formFields), props.token, true); + } + return (

- props.pushUserDetails(prepareUserDetailsToPush(values, formFields), props.token, true) - } + subscription={{ submitting: true, pristine: true }} + onSubmit={handleFormSubmit} initialValues={props.userDetails} render={({ handleSubmit, pristine, form, submitting, values, hasValidationErrors }) => ( @@ -287,9 +290,10 @@ function _PersonalInformationForm(props) {