Skip to content

Commit

Permalink
Merge pull request #183 from hackmcgill/hotfix/formSubmitted
Browse files Browse the repository at this point in the history
Set formSubmitted value
  • Loading branch information
krubenok authored Dec 13, 2018
2 parents c263faa + 4f15fe7 commit f82c9a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/containers/manageAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ class ManageAccountContainer extends React.Component<IManageAccountContainerProp
birthDate: '',
confirmed: false,
dietaryRestrictions: [],
email: getNestedProp(props, ['location','state','email']) || '',
email: getNestedProp(props, ['location', 'state', 'email']) || '',
firstName: '',
id: '',
lastName: '',
password: getNestedProp(props, ['location','state','password']) || '',
password: getNestedProp(props, ['location', 'state', 'password']) || '',
phoneNumber: '',
pronoun: '',
shirtSize: '',
Expand Down Expand Up @@ -100,7 +100,7 @@ class ManageAccountContainer extends React.Component<IManageAccountContainerProp
if (mode === ManageAccountModes.CREATE && formSubmitted) {
return <ConfirmationEmailSentComponent />
} else if (mode === ManageAccountModes.EDIT && formSubmitted) {
return <Redirect to={FrontendRoute.HOME_PAGE}/>
return <Redirect to={FrontendRoute.HOME_PAGE} />
} else {
return this.renderForm();
}
Expand Down Expand Up @@ -222,6 +222,7 @@ class ManageAccountContainer extends React.Component<IManageAccountContainerProp
await Account.create(payload);
console.log('Created an account');
await Auth.login(payload.email, payload.password);
this.setState({ formSubmitted: true });
} catch (e) {
if (e && e.data) {
ValidationErrorGenerator(e.data);
Expand Down

0 comments on commit f82c9a3

Please sign in to comment.