Skip to content

Commit 0397d08

Browse files
adjust: React unmounted component #14
1 parent 4b5ee6a commit 0397d08

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/context/UserContext.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ function loginUser(dispatch, login, password, history, setIsLoading, setError) {
5555

5656
if (!!login && !!password) {
5757
setTimeout(() => {
58-
localStorage.setItem("id_token", "1");
59-
dispatch({ type: "LOGIN_SUCCESS" });
60-
setError(null);
61-
setIsLoading(false);
58+
localStorage.setItem('id_token', 1)
59+
setError(null)
60+
setIsLoading(false)
61+
dispatch({ type: 'LOGIN_SUCCESS' })
6262

63-
history.push("/app/dashboard");
63+
history.push('/app/dashboard')
6464
}, 2000);
6565
} else {
6666
dispatch({ type: "LOGIN_FAILURE" });

0 commit comments

Comments
 (0)