From 6505a13e0037d5de5737e940907cc62c4a9107bc Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 17 Apr 2022 13:33:27 -0700 Subject: Refactor settings layout --- modern/src/map/GeofenceMap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modern/src/map/GeofenceMap.js') diff --git a/modern/src/map/GeofenceMap.js b/modern/src/map/GeofenceMap.js index c0ecef40..0d27df82 100644 --- a/modern/src/map/GeofenceMap.js +++ b/modern/src/map/GeofenceMap.js @@ -7,7 +7,7 @@ import { geofenceToFeature } from './mapUtil'; const GeofenceMap = () => { const id = 'geofences'; - const geofences = useSelector((state) => Object.values(state.geofences.items)); + const geofences = useSelector((state) => state.geofences.items); useEffect(() => { map.addSource(id, { @@ -74,7 +74,7 @@ const GeofenceMap = () => { useEffect(() => { map.getSource(id).setData({ type: 'FeatureCollection', - features: geofences.map(geofenceToFeature), + features: Object.values(geofences).map(geofenceToFeature), }); }, [geofences]); -- cgit v1.2.3