feat: Prevent users from starting levels that they did not reach yet
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user