Displaying differences for changeset |
@@ -129,14 +129,16 @@ |
} |
const onToggleWaterType = () => { |
//Set state for retrieval/reloading |
+ const waterTypeModel_local = this.state.waterTypeMode === "stream" ? "lake" : "stream" |
this.setState({ |
- waterTypeMode: |
- this.state.waterTypeMode === "stream" ? "lake" : "stream", |
+ waterTypeMode: waterTypeModel_local |
}) |
//Also set same property for wqStationsSelect so it can be included in the retrieve stations server call |
- this.props.onSetFetchLakeData( |
- !this.props.wqStationsSelect.fetchLakeData, |
- ) |
+ if (waterTypeModel_local == "lake"){ |
+ this.props.onSetFetchLakeData(true) |
+ } else { |
+ this.props.onSetFetchLakeData(false) |
+ } |
//Re-fetch/filter water quality stations |
this.props.getWQstations() |
} |