From cb63e49a9b2d3f5f26f580acba63fca611a1519d Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Fri, 14 Nov 2025 15:42:23 -0800 Subject: [PATCH] Fixed triggered event lookup. Closes #3742. --- .../[websiteId]/(reports)/funnels/FunnelEditForm.tsx | 11 +++++------ .../[websiteId]/(reports)/goals/GoalAddButton.tsx | 3 +-- src/components/common/DateDistance.tsx | 7 ++++++- src/lib/date.ts | 4 ++++ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx b/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx index 30976bff..13712f2a 100644 --- a/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx +++ b/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx @@ -56,7 +56,7 @@ export function FunnelEditForm({ const defaultValues = { name: data?.name || '', window: data?.parameters?.window || 60, - steps: data?.parameters?.steps || [{ type: 'path', value: '/' }], + steps: data?.parameters?.steps || [{ type: 'path', value: '' }], }; return ( @@ -82,12 +82,10 @@ export function FunnelEditForm({ validate: value => value.length > 1 || 'At least two steps are required', }} > - {({ fields, append, remove, getValues }) => { + {({ fields, append, remove }) => { return ( {fields.map(({ id }: { id: string }, index: number) => { - const type = getValues(`steps.${index}.type`); - return ( @@ -103,7 +101,8 @@ export function FunnelEditForm({ name={`steps.${index}.value`} rules={{ required: formatMessage(labels.required) }} > - {({ field }) => { + {({ field, context }) => { + const type = context.watch(`steps.${index}.type`); return ; }} @@ -118,7 +117,7 @@ export function FunnelEditForm({ })}