fixing warnings and updating snapshots

This commit is contained in:
Drew Taylor
2021-07-22 10:30:38 -07:00
parent 856364370f
commit eb22be3763
7 changed files with 343 additions and 340 deletions

View File

@@ -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;
}