use camera level notification enabled check

This commit is contained in:
Josh Hawkins 2025-10-28 14:49:32 -05:00
parent d5a6d2e290
commit eff6fbcc5c
3 changed files with 7 additions and 4 deletions

View File

@ -82,11 +82,11 @@ export default function CreateTriggerDialog({
const availableActions = useMemo(() => {
if (!config) return [];
if (config.notifications.enabled) {
if (config.cameras[selectedCamera].notifications.enabled_in_config) {
return ["notification", "sub_label", "attribute"];
}
return ["sub_label", "attribute"];
}, [config]);
}, [config, selectedCamera]);
const existingTriggerNames = useMemo(() => {
if (

View File

@ -243,6 +243,7 @@ export default function TriggerWizardDialog({
<Step3ThresholdAndActions
initialData={wizardState.step3Data}
trigger={trigger}
camera={selectedCamera}
onNext={handleStep3Next}
onBack={handleBack}
isLoading={isLoading}

View File

@ -28,6 +28,7 @@ export type Step3FormData = {
type Step3ThresholdAndActionsProps = {
initialData?: Step3FormData;
trigger?: Trigger | null;
camera: string;
onNext: (data: Step3FormData) => void;
onBack: () => void;
isLoading?: boolean;
@ -36,6 +37,7 @@ type Step3ThresholdAndActionsProps = {
export default function Step3ThresholdAndActions({
initialData,
trigger,
camera,
onNext,
onBack,
isLoading = false,
@ -46,11 +48,11 @@ export default function Step3ThresholdAndActions({
const availableActions = useMemo(() => {
if (!config) return [];
if (config.notifications.enabled) {
if (config.cameras[camera].notifications.enabled_in_config) {
return ["notification", "sub_label", "attribute"];
}
return ["sub_label", "attribute"];
}, [config]);
}, [config, camera]);
const formSchema = z.object({
threshold: z