Fix opening page on icon toggle

This commit is contained in:
Nick Mowen 2023-12-18 06:59:47 -07:00
parent cc95fd9901
commit 4a4fceec5c

View File

@ -94,7 +94,7 @@ function Camera({ camera }: { camera: CameraConfig }) {
return ( return (
<> <>
<Card className=""> <Card>
<a href={`/live/${camera.name}`}> <a href={`/live/${camera.name}`}>
<AspectRatio <AspectRatio
ratio={16 / 9} ratio={16 / 9}
@ -115,6 +115,7 @@ function Camera({ camera }: { camera: CameraConfig }) {
}`} }`}
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
e.preventDefault();
sendDetect(detectValue == "ON" ? "OFF" : "ON"); sendDetect(detectValue == "ON" ? "OFF" : "ON");
}} }}
> >
@ -132,6 +133,7 @@ function Camera({ camera }: { camera: CameraConfig }) {
} }
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
e.preventDefault();
camera.record.enabled_in_config camera.record.enabled_in_config
? sendRecord(recordValue == "ON" ? "OFF" : "ON") ? sendRecord(recordValue == "ON" ? "OFF" : "ON")
: {}; : {};
@ -147,6 +149,7 @@ function Camera({ camera }: { camera: CameraConfig }) {
}`} }`}
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
e.preventDefault();
sendSnapshot(detectValue == "ON" ? "OFF" : "ON"); sendSnapshot(detectValue == "ON" ? "OFF" : "ON");
}} }}
> >
@ -161,6 +164,7 @@ function Camera({ camera }: { camera: CameraConfig }) {
}`} }`}
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
e.preventDefault();
sendAudio(detectValue == "ON" ? "OFF" : "ON"); sendAudio(detectValue == "ON" ? "OFF" : "ON");
}} }}
> >