Commit f385513b authored by Florent Chehab's avatar Florent Chehab
Browse files

slight tweaks

parent 3d718d3a
Pipeline #26501 canceled with stages
in 42 seconds
......@@ -10,7 +10,10 @@ import {
class UnivMap extends Component {
componentDidMount() {
this.props.fetchData('http://127.0.0.1:8000/api/university');
if ( this.props.universities.length==0 || this.props.invalidated){
console.log("here mother uc", this.props.universities);
this.props.fetchData('http://127.0.0.1:8000/api/university');
}
}
componentDidUpdate(){
......@@ -21,6 +24,14 @@ class UnivMap extends Component {
}
}
componentWillUnmount() {
console.log("ça serait bien de save la config de la carte...");
}
render() {
if (this.props.hasError) {
return <p>Sorry! There was an error loading the items</p>;
......
......@@ -21,7 +21,7 @@ class UnivMapReloadButton extends Component {
const { classes } = this.props;
return (
<IconButton
onClick={() => { this.props.invalidate() }}
onClick={() => { this.props.invalidate(true) }}
className={classes.floatRight}
>
<CachedIcon />
......@@ -40,7 +40,7 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) => {
return {
invalidate: () => dispatch(universitiesInvalidated(true))
invalidate: (bool) => dispatch(universitiesInvalidated(bool))
};
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment