don't show audio labels if audio is not enabled

This commit is contained in:
Josh Hawkins 2026-03-27 09:18:14 -05:00
parent 22827fd3c4
commit 15cbd2d75f

View File

@ -20,11 +20,16 @@ function getReviewLabels(context: FormContext): string[] {
trackLabels.forEach((label: string) => labels.add(label)); trackLabels.forEach((label: string) => labels.add(label));
} }
// Audio labels from listen config (camera-level, falling back to global) // Audio labels from listen config, only if audio detection is enabled
const audioLabels = const audioEnabled =
fullCameraConfig?.audio?.listen ?? fullConfig?.audio?.listen; fullCameraConfig?.audio?.enabled_in_config ??
if (Array.isArray(audioLabels)) { fullConfig?.audio?.enabled_in_config;
audioLabels.forEach((label: string) => labels.add(label)); if (audioEnabled) {
const audioLabels =
fullCameraConfig?.audio?.listen ?? fullConfig?.audio?.listen;
if (Array.isArray(audioLabels)) {
audioLabels.forEach((label: string) => labels.add(label));
}
} }
// Include any labels already in the review form data (alerts + detections) // Include any labels already in the review form data (alerts + detections)