From 33ff4d73119f0fb1ba9ccfb0d4370adb5fc8af17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Fri, 18 Oct 2024 14:59:13 +0100 Subject: [PATCH] fix: Correctly set parent flow name in GovPayMetadata (#3826) --- editor.planx.uk/src/@planx/components/Pay/Public/Pay.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editor.planx.uk/src/@planx/components/Pay/Public/Pay.tsx b/editor.planx.uk/src/@planx/components/Pay/Public/Pay.tsx index 52565741e0..794f155e75 100644 --- a/editor.planx.uk/src/@planx/components/Pay/Public/Pay.tsx +++ b/editor.planx.uk/src/@planx/components/Pay/Public/Pay.tsx @@ -67,14 +67,14 @@ function Component(props: Props) { state.flowSlug, ]); const fee = props.fn ? Number(passport.data?.[props.fn]) : 0; + const defaultMetadata = [ { key: "source", value: "PlanX" }, { key: "flow", value: flowSlug }, { key: "paidViaInviteToPay", value: "@paidViaInviteToPay" }, ]; - const metadata = props.govPayMetadata?.length - ? props.govPayMetadata - : defaultMetadata; + + const metadata = [...(props.govPayMetadata || []), ...defaultMetadata]; // Handles UI states const reducer = (_state: ComponentState, action: Action): ComponentState => {