Fix click on empty space to deselect building

This commit is contained in:
Maciej Ziarkowski 2021-02-24 08:41:48 +00:00
parent 727b5fa6a9
commit 75caf768f0

View File

@ -30,10 +30,14 @@ export function useBuildingData(buildingId: number, preloadedData: Building): [B
}, [buildingId]);
const updateData = useCallback((building: Building) => {
if(building.verified == undefined) {
building.verified = {} as BuildingAttributeVerificationCounts;
if(building == undefined) {
setBuildingData(building);
} else {
if(building.verified == undefined) {
building.verified = {} as BuildingAttributeVerificationCounts;
}
setBuildingData(building);
}
setBuildingData(building);
}, []);
useEffect(() => {