From 658e7fe200632fb03dac3bc74d8021f6dd521085 Mon Sep 17 00:00:00 2001 From: Mathieu Acthernoene Date: Thu, 28 Nov 2024 15:42:58 +0100 Subject: [PATCH] Allow new iban when in account closing step --- .../banking/src/components/TransferRegularWizard.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/clients/banking/src/components/TransferRegularWizard.tsx b/clients/banking/src/components/TransferRegularWizard.tsx index 3908380fc..ccb8cd2bb 100644 --- a/clients/banking/src/components/TransferRegularWizard.tsx +++ b/clients/banking/src/components/TransferRegularWizard.tsx @@ -31,15 +31,20 @@ const BeneficiaryStep = ({ accountCountry, accountId, initialBeneficiary, + isAccountClosing, onPressSubmit, }: { accountCountry: AccountCountry; accountId: string; initialBeneficiary: SepaBeneficiary | undefined; + isAccountClosing: boolean; onPressSubmit: (beneficiary: SepaBeneficiary) => void; }) => { - const { canInitiateCreditTransferToNewBeneficiary, canCreateTrustedBeneficiary } = - usePermissions(); + const permissions = usePermissions(); + + const canCreateTrustedBeneficiary = !isAccountClosing && permissions.canCreateTrustedBeneficiary; + const canInitiateCreditTransferToNewBeneficiary = + isAccountClosing || permissions.canInitiateCreditTransferToNewBeneficiary; const [activeTab, setActiveTab] = useState( canInitiateCreditTransferToNewBeneficiary ? (initialBeneficiary?.kind ?? "new") : "saved", @@ -237,6 +242,7 @@ export const TransferRegularWizard = ({ accountCountry={accountCountry} accountId={accountId} initialBeneficiary={beneficiary} + isAccountClosing={isAccountClosing} onPressSubmit={beneficiary => { setStep({ name: "Details", beneficiary }); }}