feat: Prevent users from starting levels that they did not reach yet

This commit is contained in:
Alexander Polynomdivision
2018-10-02 17:52:07 +02:00
parent cee5680a6a
commit 5361d1bab5
4 changed files with 109 additions and 62 deletions

View File

@@ -34,6 +34,7 @@ interface IState {
levelList: {
loading: boolean;
snackbar: boolean;
};
dashboard: {
@@ -91,6 +92,7 @@ const initialState: IState = {
levelList: {
loading: true,
snackbar: false,
},
dashboard: {
@@ -248,6 +250,12 @@ export function LateinicusApp(state: IState = initialState, action: any) {
loading: action.state,
}),
});
case Actions.LEVELLIST_SET_SNACKBAR:
return Object.assign({}, state, {
levelList: Object.assign({}, state.levelList, {
snackbar: action.state,
}),
});
default:
// Ignore the initialization call to the reducer. By that we can
// catch all actions that are not implemented