Hide record switch when disabled (#12997)

This commit is contained in:
Nicolas Mowen 2024-08-12 07:21:21 -06:00 committed by GitHub
parent 13d121f443
commit 132a712341
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -412,6 +412,7 @@ export default function LiveCameraView({
)}
<FrigateCameraFeatures
camera={camera.name}
recordingEnabled={camera.record.enabled_in_config}
audioDetectEnabled={camera.audio.enabled_in_config}
autotrackingEnabled={
camera.onvif.autotracking.enabled_in_config
@ -670,12 +671,14 @@ function PtzControlPanel({
type FrigateCameraFeaturesProps = {
camera: string;
recordingEnabled: boolean;
audioDetectEnabled: boolean;
autotrackingEnabled: boolean;
fullscreen: boolean;
};
function FrigateCameraFeatures({
camera,
recordingEnabled,
audioDetectEnabled,
autotrackingEnabled,
fullscreen,
@ -764,11 +767,15 @@ function FrigateCameraFeatures({
isChecked={detectState == "ON"}
onCheckedChange={() => sendDetect(detectState == "ON" ? "OFF" : "ON")}
/>
<FilterSwitch
label="Recording"
isChecked={recordState == "ON"}
onCheckedChange={() => sendRecord(recordState == "ON" ? "OFF" : "ON")}
/>
{recordingEnabled && (
<FilterSwitch
label="Recording"
isChecked={recordState == "ON"}
onCheckedChange={() =>
sendRecord(recordState == "ON" ? "OFF" : "ON")
}
/>
)}
<FilterSwitch
label="Snapshots"
isChecked={snapshotState == "ON"}