Skip to content

Commit

Permalink
Merge pull request #4059 from marmelab/fix-demo-login
Browse files Browse the repository at this point in the history
Fix warning about unmounted component after Login on Demo
  • Loading branch information
fzaninotto authored Nov 27, 2019
2 parents 77e9eef + 2839110 commit 73c6481
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/demo/src/layout/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ const Login = ({ location }) => {

const handleSubmit = auth => {
setLoading(true);
login(auth, location.state ? location.state.nextPathname : '/')
.then(() => setLoading(false))
.catch(error => {
login(auth, location.state ? location.state.nextPathname : '/').catch(
error => {
setLoading(false);
notify(
typeof error === 'string'
Expand All @@ -91,7 +90,8 @@ const Login = ({ location }) => {
: error.message,
'warning'
);
});
}
);
};

const validate = values => {
Expand Down

0 comments on commit 73c6481

Please sign in to comment.