mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-11 17:47:37 +03:00
use camera level notification enabled check
This commit is contained in:
parent
d5a6d2e290
commit
eff6fbcc5c
@ -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 (
|
||||
|
||||
@ -243,6 +243,7 @@ export default function TriggerWizardDialog({
|
||||
<Step3ThresholdAndActions
|
||||
initialData={wizardState.step3Data}
|
||||
trigger={trigger}
|
||||
camera={selectedCamera}
|
||||
onNext={handleStep3Next}
|
||||
onBack={handleBack}
|
||||
isLoading={isLoading}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user