Diplay ECU name in update status (#110)

Optimize car update status progress control
Remove car update status page test
Replace with individual component tests
This commit is contained in:
John Wu
2021-11-15 09:12:03 -08:00
committed by GitHub
parent 4318ce9048
commit 537e8ed30b
14 changed files with 2540 additions and 1068 deletions

View File

@@ -19,8 +19,7 @@ const MainForm = () => {
const [manifest, setManifest] = useState(null);
const [status, setStatus] = useState(null);
const { setTitle, setSitePath, setMessage } = useStatusContext();
const { getCarUpdates, carUpdates, startMonitor, stopMonitor } =
useCarUpdatesContext();
const { getCarUpdates, carUpdates } = useCarUpdatesContext();
const {
token: {
idToken: { jwtToken: token },
@@ -66,17 +65,15 @@ const MainForm = () => {
try {
if (carUpdates.length === 0) return;
setStatus(carUpdates[0]);
startMonitor(token);
} catch (e) {
setMessage(e.message);
logger.warn(e.stack);
}
return () => {
stopMonitor();
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [carUpdates]);
if (!status) return null;
return (
<div className={classes.root}>
<Grid container spacing={2}>