Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments: Give Feedback While Logging In #43

Closed
jayair opened this issue Apr 10, 2017 · 7 comments

Comments

Projects
None yet
4 participants
@jayair
Copy link
Member

commented Apr 10, 2017

@jayair jayair added the Discussion label Apr 10, 2017

@staskh

This comment has been minimized.

Copy link

commented Jan 2, 2018

Please correct me if I wrong, but in handleSubmit function "isLoading" state will turn back to false only if try block failed. Don't you have to have something like:
handleSubmit = async event => {

event.preventDefault();

this.setState({ isLoading: true });

try {
  await this.login(this.state.email, this.state.password);
  this.props.userHasAuthenticated(true);
  this.props.history.push("/");
  //alert("Logged in");
} catch (e) {
  alert(e);
}

this.setState({ isLoading: false }); /* <-- moving isLoading state setting otside of try block? */

}

@jayair

This comment has been minimized.

Copy link
Member Author

commented Jan 2, 2018

@staskh You could but in this case, we end up redirecting after the login is successful. So we don't have to explicitly handle it.

@verdavaine

This comment has been minimized.

Copy link

commented Apr 2, 2018

That's right but when you logout, your Login button is still in Loading state, before submitting the form.

@jayair

This comment has been minimized.

Copy link
Member Author

commented Apr 2, 2018

@verdavaine Not quite, React Router unloads our Login container completely. So when it is brought up the next time it starts with the default state.

@jayair

This comment has been minimized.

Copy link
Member Author

commented May 9, 2018

@jayair jayair closed this May 9, 2018

@tickcode

This comment has been minimized.

Copy link

commented May 25, 2018

For some reason the LoaderButton is not showing the spinning glyph. I've gone back over the tutorial a number of times to make sure there wasn't a typo. Is anyone else having this issue? (Using Chrome)

@tickcode

This comment has been minimized.

Copy link

commented May 25, 2018

Sorry, false alarm here. I missed "isLoading={this.state.isLoading}" in the tag of Login.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.