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 { ...@@ -10,7 +10,10 @@ import {
class UnivMap extends Component { class UnivMap extends Component {
componentDidMount() { 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(){ componentDidUpdate(){
...@@ -21,6 +24,14 @@ class UnivMap extends Component { ...@@ -21,6 +24,14 @@ class UnivMap extends Component {
} }
} }
componentWillUnmount() {
console.log("ça serait bien de save la config de la carte...");
}
render() { render() {
if (this.props.hasError) { if (this.props.hasError) {
return <p>Sorry! There was an error loading the items</p>; return <p>Sorry! There was an error loading the items</p>;
......
...@@ -21,7 +21,7 @@ class UnivMapReloadButton extends Component { ...@@ -21,7 +21,7 @@ class UnivMapReloadButton extends Component {
const { classes } = this.props; const { classes } = this.props;
return ( return (
<IconButton <IconButton
onClick={() => { this.props.invalidate() }} onClick={() => { this.props.invalidate(true) }}
className={classes.floatRight} className={classes.floatRight}
> >
<CachedIcon /> <CachedIcon />
...@@ -40,7 +40,7 @@ const mapStateToProps = (state) => { ...@@ -40,7 +40,7 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { 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