Skip to content

Commit

Permalink
Merge pull request #38330 from bernhardoj/fix/plaid-reopening-on-rere…
Browse files Browse the repository at this point in the history
…nder

Fix connect option page is shown instead of bank selection page
  • Loading branch information
chiragsalian authored Mar 15, 2024
2 parents 8b54aff + 0041cf0 commit c5634fd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/AddPlaidBankAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ function AddPlaidBankAccount({
onInputChange(plaidAccountID);
};

const handlePlaidError = useCallback((error: ErrorEvent | null) => {
Log.hmmm('[PlaidLink] Error: ', error?.message);
}, []);

if (isPlaidDisabled) {
return (
<View>
Expand All @@ -204,9 +208,7 @@ function AddPlaidBankAccount({
Log.info('[PlaidLink] Success!');
BankAccounts.openPlaidBankAccountSelector(publicToken, metadata?.institution?.name ?? '', allowDebit, bankAccountID);
}}
onError={(error) => {
Log.hmmm('[PlaidLink] Error: ', error?.message);
}}
onError={handlePlaidError}
onEvent={(event, metadata) => {
BankAccounts.setPlaidEvent(event);
// Handle Plaid login errors (will potentially reset plaid token and item depending on the error)
Expand Down

0 comments on commit c5634fd

Please sign in to comment.