mirror of
https://github.com/vale981/accounts-ui
synced 2025-03-04 17:31:41 -05:00
populate default field values from local storage when the form did mount on the client
This commit is contained in:
parent
32b08c7cff
commit
9fdfecf6e3
1 changed files with 5 additions and 2 deletions
|
@ -44,8 +44,6 @@ export class LoginForm extends Tracker.Component {
|
|||
onSignedOutHook: props.onSignedOutHook || Accounts.ui._options.onSignedOutHook,
|
||||
onPreSignUpHook: props.onPreSignUpHook || Accounts.ui._options.onPreSignUpHook,
|
||||
onPostSignUpHook: props.onPostSignUpHook || Accounts.ui._options.onPostSignUpHook,
|
||||
// Add default field values.
|
||||
...this.getDefaultFieldValues(),
|
||||
};
|
||||
|
||||
// Listen for the user to login/logout.
|
||||
|
@ -82,6 +80,11 @@ export class LoginForm extends Tracker.Component {
|
|||
Session.set(KEY_PREFIX + 'state', null);
|
||||
break;
|
||||
}
|
||||
|
||||
// Add default field values once the form did mount on the client
|
||||
this.setState({
|
||||
...this.getDefaultFieldValues(),
|
||||
});
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
|
|
Loading…
Add table
Reference in a new issue