Fix/map update (#450)
* Move building deselect logic from map-app to mapp * Use building_id instead of ref_toid in handleClick
This commit is contained in:
parent
14bc6e0d91
commit
13495ab495
@ -80,9 +80,7 @@ class MapApp extends React.Component<MapAppProps, MapAppState> {
|
||||
const mode = this.props.match.params.mode || 'view';
|
||||
const category = this.props.match.params.category || 'age';
|
||||
|
||||
if (building == undefined ||
|
||||
(this.state.building != undefined &&
|
||||
building.building_id === this.state.building.building_id)) {
|
||||
if (building == undefined) {
|
||||
this.setState({ building: undefined });
|
||||
this.props.history.push(`/${mode}/${category}`);
|
||||
return;
|
||||
|
@ -77,8 +77,10 @@ class ColouringMap extends Component<ColouringMapProps, ColouringMapState> { //
|
||||
if (mode === 'multi-edit') {
|
||||
// colour building directly
|
||||
this.props.colourBuilding(building);
|
||||
} else {
|
||||
} else if (this.props.building == undefined || building.building_id !== this.props.building.building_id){
|
||||
this.props.selectBuilding(building);
|
||||
} else {
|
||||
this.props.selectBuilding(undefined);
|
||||
}
|
||||
} else {
|
||||
// deselect but keep/return to expected colour theme
|
||||
|
Loading…
Reference in New Issue
Block a user