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(() => {
|
const availableActions = useMemo(() => {
|
||||||
if (!config) return [];
|
if (!config) return [];
|
||||||
|
|
||||||
if (config.notifications.enabled) {
|
if (config.cameras[selectedCamera].notifications.enabled_in_config) {
|
||||||
return ["notification", "sub_label", "attribute"];
|
return ["notification", "sub_label", "attribute"];
|
||||||
}
|
}
|
||||||
return ["sub_label", "attribute"];
|
return ["sub_label", "attribute"];
|
||||||
}, [config]);
|
}, [config, selectedCamera]);
|
||||||
|
|
||||||
const existingTriggerNames = useMemo(() => {
|
const existingTriggerNames = useMemo(() => {
|
||||||
if (
|
if (
|
||||||
|
|||||||
@ -243,6 +243,7 @@ export default function TriggerWizardDialog({
|
|||||||
<Step3ThresholdAndActions
|
<Step3ThresholdAndActions
|
||||||
initialData={wizardState.step3Data}
|
initialData={wizardState.step3Data}
|
||||||
trigger={trigger}
|
trigger={trigger}
|
||||||
|
camera={selectedCamera}
|
||||||
onNext={handleStep3Next}
|
onNext={handleStep3Next}
|
||||||
onBack={handleBack}
|
onBack={handleBack}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
|
|||||||
@ -28,6 +28,7 @@ export type Step3FormData = {
|
|||||||
type Step3ThresholdAndActionsProps = {
|
type Step3ThresholdAndActionsProps = {
|
||||||
initialData?: Step3FormData;
|
initialData?: Step3FormData;
|
||||||
trigger?: Trigger | null;
|
trigger?: Trigger | null;
|
||||||
|
camera: string;
|
||||||
onNext: (data: Step3FormData) => void;
|
onNext: (data: Step3FormData) => void;
|
||||||
onBack: () => void;
|
onBack: () => void;
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
@ -36,6 +37,7 @@ type Step3ThresholdAndActionsProps = {
|
|||||||
export default function Step3ThresholdAndActions({
|
export default function Step3ThresholdAndActions({
|
||||||
initialData,
|
initialData,
|
||||||
trigger,
|
trigger,
|
||||||
|
camera,
|
||||||
onNext,
|
onNext,
|
||||||
onBack,
|
onBack,
|
||||||
isLoading = false,
|
isLoading = false,
|
||||||
@ -46,11 +48,11 @@ export default function Step3ThresholdAndActions({
|
|||||||
const availableActions = useMemo(() => {
|
const availableActions = useMemo(() => {
|
||||||
if (!config) return [];
|
if (!config) return [];
|
||||||
|
|
||||||
if (config.notifications.enabled) {
|
if (config.cameras[camera].notifications.enabled_in_config) {
|
||||||
return ["notification", "sub_label", "attribute"];
|
return ["notification", "sub_label", "attribute"];
|
||||||
}
|
}
|
||||||
return ["sub_label", "attribute"];
|
return ["sub_label", "attribute"];
|
||||||
}, [config]);
|
}, [config, camera]);
|
||||||
|
|
||||||
const formSchema = z.object({
|
const formSchema = z.object({
|
||||||
threshold: z
|
threshold: z
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user