fix: Multiple API calls when bypassing /login
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user