fix: Multiple API calls when bypassing /login

This commit is contained in:
Alexander Polynomdivision
2018-09-23 16:30:14 +02:00
parent 08cd51c2a3
commit be7a616fb5
7 changed files with 41 additions and 13 deletions

View File

@@ -11,6 +11,7 @@ interface IState {
scorePopoverOpen: boolean;
drawerButton: boolean;
authenticated: boolean;
didLogin: boolean;
// TODO: Rework this
user: IUser | {},
@@ -64,6 +65,7 @@ const initialState: IState = {
// Should we show the button to open the drawer?
drawerButton: true,
scorePopoverOpen: false,
didLogin: false,
// Is the user authenticated?
// TODO: Set this to false
@@ -228,7 +230,6 @@ export function LateinicusApp(state: IState = initialState, action: any) {
}),
});
case Actions.SET_TOP_TEN:
console.log(action.topTen);
return Object.assign({}, state, {
topTen: action.topTen,
});
@@ -238,6 +239,10 @@ export function LateinicusApp(state: IState = initialState, action: any) {
loadingTT: action.state,
}),
});
case Actions.SET_DID_LOGIN:
return Object.assign({}, state, {
didLogin: state,
});
default:
// Ignore the initialization call to the reducer. By that we can
// catch all actions that are not implemented