fixing warnings and updating snapshots
This commit is contained in:
@@ -37,6 +37,7 @@ const Component = () => {
|
||||
retrieveAndStoreLocations();
|
||||
}, REQUEST_INTERVAL);
|
||||
return () => { clearInterval(id) };
|
||||
// eslint-disable-next-line
|
||||
}, []);
|
||||
|
||||
const retrieveAndStoreLocations = () => {
|
||||
@@ -76,7 +77,8 @@ const Component = () => {
|
||||
setConnections(connections);
|
||||
})
|
||||
}
|
||||
}, [markers])
|
||||
// eslint-disable-next-line
|
||||
}, [markers, token])
|
||||
|
||||
const [selectedVIN, setSelectedVIN] = useState(null);
|
||||
const [carState, setCarState] = useState(null);
|
||||
@@ -89,6 +91,7 @@ const Component = () => {
|
||||
}, REQUEST_INTERVAL);
|
||||
return () => { clearInterval(id) };
|
||||
}
|
||||
// eslint-disable-next-line
|
||||
}, [selectedVIN]);
|
||||
|
||||
const selectCar = (e, vin) => {
|
||||
@@ -166,6 +169,7 @@ const Component = () => {
|
||||
{
|
||||
carState ? (
|
||||
<VehiclePopUp
|
||||
key={carState.vin}
|
||||
vin={carState.vin}
|
||||
online={carState.online}
|
||||
battery={carState.battery}
|
||||
@@ -183,13 +187,15 @@ const Component = () => {
|
||||
|
||||
const CenterFocus = ({ center, zoom }) => {
|
||||
const map = useMap();
|
||||
|
||||
useEffect(() => {
|
||||
if (center[0] === 0 && center[1] === 0) {
|
||||
center = [0, 0]
|
||||
zoom = 2
|
||||
map.flyTo([0, 0], 2, { duration: 1.5 });
|
||||
} else {
|
||||
map.flyTo(center, zoom, { duration: 1.5 });
|
||||
}
|
||||
map.flyTo(center, zoom, { duration: 1.5 });
|
||||
}, [center, zoom]);
|
||||
}, [center, zoom, map]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user