Skip to content

Commit

Permalink
Merge pull request #50171 from daledah/fix/50150
Browse files Browse the repository at this point in the history
fix: error not shown, redirect incorrectly on add bank account
(cherry picked from commit 238f978)

(CP triggered by jasperhuangg)
  • Loading branch information
jasperhuangg authored and OSBotify committed Oct 3, 2024
1 parent e965ffd commit 75ea170
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,8 @@ function BaseValidateCodeForm({
);

useEffect(() => {
if (!validateError) {
return;
}
clearError();
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, [clearError, validateError]);
}, [clearError]);

useEffect(() => {
if (!hasMagicCodeBeenSent) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/AddPersonalBankAccountPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function AddPersonalBankAccountPage() {
} else if (shouldContinue && onSuccessFallbackRoute) {
PaymentMethods.continueSetup(onSuccessFallbackRoute);
} else {
Navigation.goBack();
Navigation.navigate(ROUTES.SETTINGS_WALLET);
}
},
[personalBankAccount],
Expand Down
6 changes: 5 additions & 1 deletion src/pages/settings/Wallet/VerifyAccountPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ function VerifyAccountPage({route}: VerifyAccountPageProps) {
[loginList, contactMethod],
);

const clearError = useCallback(() => {
User.clearContactMethodErrors(contactMethod, 'validateLogin');
}, [contactMethod]);

useEffect(() => {
if (!isUserValidated) {
return;
Expand All @@ -73,7 +77,7 @@ function VerifyAccountPage({route}: VerifyAccountPageProps) {
validateCodeAction={validateCodeAction}
validateError={validateLoginError}
handleSubmitForm={handleSubmitForm}
clearError={() => User.clearContactMethodErrors(contactMethod, 'validateLogin')}
clearError={clearError}
buttonStyles={[styles.justifyContentEnd, styles.flex1, safePaddingBottomStyle]}
/>
</View>
Expand Down

0 comments on commit 75ea170

Please sign in to comment.