refactor(web): async routing

This commit is contained in:
Paul Armstrong
2021-02-07 13:46:05 -08:00
committed by Blake Blackshear
parent 24ec13e36d
commit 7aee28d080
14 changed files with 95 additions and 93 deletions

View File

@@ -50,7 +50,7 @@ export default function CameraImage({ camera, onload, searchParams = '' }) {
);
useEffect(() => {
if (!scaledHeight) {
if (!scaledHeight || !canvasRef.current) {
return;
}
img.src = `${apiHost}/api/${name}/latest.jpg?h=${scaledHeight}${searchParams ? `&${searchParams}` : ''}`;