From 0890b9948b78090d477105b232a8b0b80527abdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Ram=C3=ADrez?= Date: Thu, 28 Aug 2025 14:58:44 -0300 Subject: [PATCH] fix: show error on dynamic bank account form --- .../AddWithdraw/AddWithdrawCountriesList.tsx | 1 + .../AddWithdraw/DynamicBankAccountForm.tsx | 12 +++++++++++- .../Claim/Link/views/BankFlowManager.view.tsx | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/AddWithdraw/AddWithdrawCountriesList.tsx b/src/components/AddWithdraw/AddWithdrawCountriesList.tsx index ba00c7fb6..38884c5a2 100644 --- a/src/components/AddWithdraw/AddWithdrawCountriesList.tsx +++ b/src/components/AddWithdraw/AddWithdrawCountriesList.tsx @@ -204,6 +204,7 @@ const AddWithdrawCountriesList = ({ flow }: AddWithdrawCountriesListProps) => { country={getCountryCodeForWithdraw(currentCountry.id)} onSuccess={handleFormSubmit} initialData={{}} + error={null} /> flow?: 'claim' | 'withdraw' actionDetailsProps?: Partial + error: string | null } export const DynamicBankAccountForm = forwardRef<{ handleSubmit: () => void }, DynamicBankAccountFormProps>( ( - { country, onSuccess, initialData, flow = 'withdraw', actionDetailsProps, countryName: countryNameFromProps }, + { + country, + onSuccess, + initialData, + flow = 'withdraw', + actionDetailsProps, + countryName: countryNameFromProps, + error, + }, ref ) => { const { user } = useAuth() @@ -394,6 +403,7 @@ export const DynamicBankAccountForm = forwardRef<{ handleSubmit: () => void }, D Review {submissionError && } + {error && } diff --git a/src/components/Claim/Link/views/BankFlowManager.view.tsx b/src/components/Claim/Link/views/BankFlowManager.view.tsx index 403c7d777..c08e9dbb8 100644 --- a/src/components/Claim/Link/views/BankFlowManager.view.tsx +++ b/src/components/Claim/Link/views/BankFlowManager.view.tsx @@ -209,6 +209,9 @@ export const BankFlowManager = (props: IClaimScreenProps) => { payload: AddBankAccountPayload, rawData: IBankAccountDetails ): Promise<{ error?: string }> => { + //clean any error from previous step + setError(null) + // scenario 1: receiver needs KYC if (bankClaimType === BankClaimType.ReceiverKycNeeded && !justCompletedKyc) { // update user's name and email if they are not present @@ -456,6 +459,7 @@ export const BankFlowManager = (props: IClaimScreenProps) => { tokenSymbol: claimLinkData.tokenSymbol, }} initialData={{}} + error={error} />