Skip to content

Commit

Permalink
adjust: React unmounted component #14
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldaineka committed Nov 21, 2019
1 parent 4b5ee6a commit 0397d08
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/context/UserContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ function loginUser(dispatch, login, password, history, setIsLoading, setError) {

if (!!login && !!password) {
setTimeout(() => {
localStorage.setItem("id_token", "1");
dispatch({ type: "LOGIN_SUCCESS" });
setError(null);
setIsLoading(false);
localStorage.setItem('id_token', 1)
setError(null)
setIsLoading(false)
dispatch({ type: 'LOGIN_SUCCESS' })

history.push("/app/dashboard");
history.push('/app/dashboard')
}, 2000);
} else {
dispatch({ type: "LOGIN_FAILURE" });
Expand Down

0 comments on commit 0397d08

Please sign in to comment.