Fix click on empty space to deselect building
This commit is contained in:
parent
727b5fa6a9
commit
75caf768f0
@ -30,10 +30,14 @@ export function useBuildingData(buildingId: number, preloadedData: Building): [B
|
|||||||
}, [buildingId]);
|
}, [buildingId]);
|
||||||
|
|
||||||
const updateData = useCallback((building: Building) => {
|
const updateData = useCallback((building: Building) => {
|
||||||
|
if(building == undefined) {
|
||||||
|
setBuildingData(building);
|
||||||
|
} else {
|
||||||
if(building.verified == undefined) {
|
if(building.verified == undefined) {
|
||||||
building.verified = {} as BuildingAttributeVerificationCounts;
|
building.verified = {} as BuildingAttributeVerificationCounts;
|
||||||
}
|
}
|
||||||
setBuildingData(building);
|
setBuildingData(building);
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user