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

@@ -1,6 +1,8 @@
import { connect } from "react-redux";
import { setLevelListLoading, setLevels } from "../actions";
import {
setLevelListLoading, setLevels, setLevelListSnackbar
} from "../actions";
import { ILevel } from "../models/level";
@@ -11,12 +13,14 @@ const mapStateToProps = state => {
levels: state.levels,
loading: state.levelList.loading,
user: state.user,
snackbar: state.levelList.snackbar,
};
};
const mapDispatchToProps = dispatch => {
return {
setLoading: (state: boolean) => dispatch(setLevelListLoading(state)),
setLevels: (levels: ILevel[]) => dispatch(setLevels(levels)),
setSnackbar: (state: boolean) => dispatch(setLevelListSnackbar(state)),
};
};