Skip to content

Commit 4777fa7

Browse files
committed
chore(locate): hide edit location when feature selected
1 parent aa29377 commit 4777fa7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

plugins/lime-plugin-mesh-wide/src/containers/LocateNode.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import {
77
useChangeLocation,
88
useLocation,
99
} from "plugins/lime-plugin-mesh-wide/src/locateNodeQueries";
10+
import { useSelectedMapFeature } from "plugins/lime-plugin-mesh-wide/src/meshWideQueries";
1011

1112
import queryCache from "utils/queryCache";
1213

1314
const LocateNode = ({}) => {
1415
const { editingLocation, setEditingLocation, mapRef } = useLocateNode();
16+
const { data: selectedMapFeature } = useSelectedMapFeature();
1517

1618
const { data: nodeLocation, isLoading } = useLocation({});
1719

@@ -44,7 +46,7 @@ const LocateNode = ({}) => {
4446
changeLocation({ lat: position.lat, lon: position.lng });
4547
};
4648

47-
if (!loaded) {
49+
if (!loaded || selectedMapFeature) {
4850
return null;
4951
}
5052

0 commit comments

Comments
 (0)