weird zoom bug

This commit is contained in:
Drew Taylor
2021-07-14 17:09:17 -07:00
parent c0a11de056
commit 1bb679a3f8
6 changed files with 179 additions and 64 deletions

View File

@@ -137,6 +137,18 @@ export const VehicleProvider = ({ children }) => {
}
};
const getState = async (token, vin) => {
try {
setBusy(true);
const result = await api.getState(token, vin);
if (result.error)
throw new Error(`Get state error. ${result.message}`);
return result;
} finally {
setBusy(false);
}
};
return (
<VehicleContext.Provider
value={{
@@ -152,6 +164,7 @@ export const VehicleProvider = ({ children }) => {
sendCommand,
getConnections,
getLocations,
getState,
}}
>
{children}