Skip to content

Commit

Permalink
Allow new iban when in account closing step
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Nov 28, 2024
1 parent 8352014 commit 658e7fe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions clients/banking/src/components/TransferRegularWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -237,6 +242,7 @@ export const TransferRegularWizard = ({
accountCountry={accountCountry}
accountId={accountId}
initialBeneficiary={beneficiary}
isAccountClosing={isAccountClosing}
onPressSubmit={beneficiary => {
setStep({ name: "Details", beneficiary });
}}
Expand Down

0 comments on commit 658e7fe

Please sign in to comment.