From d7a4e0bee2b2964e94cb36caeade1431394feb5e Mon Sep 17 00:00:00 2001 From: Nathalie Kuoch Date: Thu, 31 Aug 2023 14:29:47 +0200 Subject: [PATCH] Restrict Plaid link on Native too --- src/components/PlaidLink/index.native.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/PlaidLink/index.native.js b/src/components/PlaidLink/index.native.js index cd17453820cf..48cd41e283c3 100644 --- a/src/components/PlaidLink/index.native.js +++ b/src/components/PlaidLink/index.native.js @@ -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({ @@ -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();