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() { ...@@ -9,8 +9,8 @@ export function reset() {
return { type: RESET }; return { type: RESET };
} }
export function success(username, token, displayName, photo) { export function success(username, token, displayName, photo, loginState = 'success') {
return { type: SUCCESS, payload: { username, token, displayName, photo } }; return { type: SUCCESS, payload: { username, token, displayName, photo, loginState } };
} }
export function fetching() { export function fetching() {
......
...@@ -42,8 +42,7 @@ class Main extends Component { ...@@ -42,8 +42,7 @@ class Main extends Component {
const photo = values[PHOTOKEY]; const photo = values[PHOTOKEY];
if (username !== null && token !== null) { if (username !== null && token !== null) {
store.dispatch(loginActions.success(username, token, displayName, photo)); store.dispatch(loginActions.success(username, token, displayName, photo, ''));
store.dispatch(loginActions.reset());
} }
}); });
} }
......
...@@ -13,7 +13,7 @@ export default function session(state = initialState, action = {}) { ...@@ -13,7 +13,7 @@ export default function session(state = initialState, action = {}) {
case loginActions.SUCCESS: case loginActions.SUCCESS:
return { return {
...state, ...state,
loginState: 'success', loginState: action.payload.loginState,
username: action.payload.username, username: action.payload.username,
token: action.payload.token, token: action.payload.token,
displayName: action.payload.displayName, 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