Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a5e3579

Browse files
author
Cristian
committed
Add setSubmitting to false when response is received
1 parent cbe7fda commit a5e3579

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

‎imports/ui/components/Forms/LoginForm.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ const LoginForm = props => (
1414
const { history } = props;
1515
const { email, password } = values;
1616
Meteor.loginWithPassword(email, password, (err) => {
17+
setSubmitting(false);
1718
if (err) {
1819
Bert.alert(err.reason, 'danger');
1920
return false;
2021
}
2122
Bert.alert('Logged in', 'success');
22-
setSubmitting(false);
2323
history.push('/');
2424
});
2525
}}

‎imports/ui/components/Forms/RegisterForm.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ const RegisterForm = (props) => {
2525
onSubmit={(values, { setSubmitting }) => {
2626
const { email, password, username } = values;
2727
Meteor.call('createNewUser', { email, password, username }, (err) => {
28+
setSubmitting(false);
2829
if (err) {
2930
Bert.alert(err.reason, 'danger');
3031
return false;
3132
}
32-
setSubmitting(false);
3333
login(email, password);
3434
});
3535
}}

‎imports/ui/components/Forms/UserProfileForm.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class UserProfileForm extends Component {
3131
const options = { username: values.username };
3232

3333
Meteor.call('updateUserData', Meteor.userId(), options, (err) => {
34+
setSubmitting(false);
3435
if (err) {
3536
Bert.alert(
3637
`There was an error trying to update your user data ${err.message}`,
@@ -39,7 +40,6 @@ class UserProfileForm extends Component {
3940
return false;
4041
}
4142
Bert.alert('Your profile was updated successfully', 'success');
42-
setSubmitting(false);
4343
});
4444
}}
4545
render={({

‎imports/ui/pages/LoginPage.js‎

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,21 @@ const LoginPage = () => (
99
<Header textAlign="center" as="h3">
1010
Please Sign in
1111
</Header>
12-
<Segment />
13-
<LoginForm />
14-
<p className="login-subtitle">
15-
Not a member?
16-
{' '}
17-
<Link color="black" to="/register">
18-
Sign up here
19-
</Link>
20-
</p>
21-
<p className="login-subtitle">
22-
Forgot password?
23-
{' '}
24-
<Link to="/forgot-password">Click here</Link>
25-
</p>
12+
<Segment>
13+
<LoginForm />
14+
<p className="login-subtitle">
15+
Not a member?
16+
{' '}
17+
<Link color="black" to="/register">
18+
Sign up here
19+
</Link>
20+
</p>
21+
<p className="login-subtitle">
22+
Forgot password?
23+
{' '}
24+
<Link to="/forgot-password">Click here</Link>
25+
</p>
26+
</Segment>
2627
</Grid.Column>
2728
</Grid>
2829
);

‎imports/ui/pages/MyAccountPage.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import ChangePasswordForm from '../components/Forms/ChangePasswordForm';
77
const MyAccountPage = (props) => {
88
const changePassword = (values, { setSubmitting }) => {
99
Meteor.call('changeUserPassword', Meteor.userId(), values.passwordConfirm, (err) => {
10+
setSubmitting(false);
1011
if (err) {
1112
Bert.alert(`There was an error trying to update your password ${err.message}`, 'danger');
1213
return false;
1314
}
1415
Bert.alert('Your password was updated successfully', 'success');
15-
setSubmitting(false);
1616
// We need to wait 1 second before redirecting user to login
1717
// That's because meteor userId() does not update instantly
1818
setTimeout(() => {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /