Skip to content

Commit

Permalink
Merge pull request #26394 from Expensify/nat-plaidnativ
Browse files Browse the repository at this point in the history
Restrict Plaid link on Native too
  • Loading branch information
luacmartins authored Sep 13, 2023
2 parents 0df67e1 + d7a4e0b commit 331e004
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/components/PlaidLink/index.native.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import {useEffect} from 'react';
import {openLink, useDeepLinkRedirector, usePlaidEmitter} from 'react-native-plaid-link-sdk';
import Log from '../../libs/Log';
import CONST from '../../CONST';
import {plaidLinkPropTypes, plaidLinkDefaultProps} from './plaidLinkPropTypes';

function PlaidLink(props) {
useDeepLinkRedirector();
usePlaidEmitter((event) => {
Log.info('[PlaidLink] Handled Plaid Event: ', false, event);
if (event.eventName === CONST.PLAID.EVENT.ERROR) {
props.onError(event.metadata);
}
props.onEvent(event.eventName, event.metadata);
});
useEffect(() => {
openLink({
Expand All @@ -20,9 +17,6 @@ function PlaidLink(props) {
onSuccess: ({publicToken, metadata}) => {
props.onSuccess({publicToken, metadata});
},
onEvent: (event, metadata) => {
props.onEvent(event, metadata);
},
onExit: (exitError, metadata) => {
Log.info('[PlaidLink] Exit: ', false, {exitError, metadata});
props.onExit();
Expand Down

0 comments on commit 331e004

Please sign in to comment.