Commit 0202d736 authored by Gijs Hendriksen's avatar Gijs Hendriksen
Browse files

Remove snackbar altogether when already logged in

parent 0eb2e05b
......@@ -9,8 +9,8 @@ export function reset() {
return { type: RESET };
}
export function success(username, token, displayName, photo) {
return { type: SUCCESS, payload: { username, token, displayName, photo } };
export function success(username, token, displayName, photo, loginState = 'success') {
return { type: SUCCESS, payload: { username, token, displayName, photo, loginState } };
}
export function fetching() {
......
......@@ -42,8 +42,7 @@ class Main extends Component {
const photo = values[PHOTOKEY];
if (username !== null && token !== null) {
store.dispatch(loginActions.success(username, token, displayName, photo));
store.dispatch(loginActions.reset());
store.dispatch(loginActions.success(username, token, displayName, photo, ''));
}
});
}
......
......@@ -13,7 +13,7 @@ export default function session(state = initialState, action = {}) {
case loginActions.SUCCESS:
return {
...state,
loginState: 'success',
loginState: action.payload.loginState,
username: action.payload.username,
token: action.payload.token,
displayName: action.payload.displayName,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment