From fa54fc57137d0695f5e65f375659a77c08987216 Mon Sep 17 00:00:00 2001 From: Jayesh Mangwani Date: Tue, 19 Mar 2024 19:54:38 +0530 Subject: [PATCH 1/2] fix @ts-expect-error warning --- src/pages/EnablePayments/OnfidoStep.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pages/EnablePayments/OnfidoStep.tsx b/src/pages/EnablePayments/OnfidoStep.tsx index 46c6e1c8e6ed..06ad9ca3a922 100644 --- a/src/pages/EnablePayments/OnfidoStep.tsx +++ b/src/pages/EnablePayments/OnfidoStep.tsx @@ -3,8 +3,8 @@ import {withOnyx} from 'react-native-onyx'; import type {OnyxEntry} from 'react-native-onyx'; import FullPageOfflineBlockingView from '@components/BlockingViews/FullPageOfflineBlockingView'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; -// @ts-expect-error TODO: Remove this once Onfido (https://github.com/Expensify/App/issues/25136) is migrated to TypeScript. import Onfido from '@components/Onfido'; +import type {OnfidoData} from '@components/Onfido/types'; import useLocalize from '@hooks/useLocalize'; import Growl from '@libs/Growl'; import Navigation from '@libs/Navigation/Navigation'; @@ -45,8 +45,7 @@ function OnfidoStep({walletOnfidoData = DEFAULT_WALLET_ONFIDO_DATA}: OnfidoStepP }, [translate]); const verifyIdentity = useCallback( - // @ts-expect-error TODO: Remove this once Onfido (https://github.com/Expensify/App/issues/25136) is migrated to TypeScript. - (data) => { + (data: OnfidoData) => { BankAccounts.verifyIdentity({ onfidoData: JSON.stringify({ ...data, @@ -64,7 +63,7 @@ function OnfidoStep({walletOnfidoData = DEFAULT_WALLET_ONFIDO_DATA}: OnfidoStepP onBackButtonPress={goToPreviousStep} /> - {shouldShowOnfido ? ( + {shouldShowOnfido && walletOnfidoData?.sdkToken ? ( Date: Tue, 19 Mar 2024 20:22:28 +0530 Subject: [PATCH 2/2] added a empty string instead doublechecking walletOnfidoData.sdkToken --- src/pages/EnablePayments/OnfidoStep.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/EnablePayments/OnfidoStep.tsx b/src/pages/EnablePayments/OnfidoStep.tsx index 06ad9ca3a922..f5a600cc8548 100644 --- a/src/pages/EnablePayments/OnfidoStep.tsx +++ b/src/pages/EnablePayments/OnfidoStep.tsx @@ -63,9 +63,9 @@ function OnfidoStep({walletOnfidoData = DEFAULT_WALLET_ONFIDO_DATA}: OnfidoStepP onBackButtonPress={goToPreviousStep} /> - {shouldShowOnfido && walletOnfidoData?.sdkToken ? ( + {shouldShowOnfido ? (