diff --git a/src/components/ConnectToXeroFlow/index.native.tsx b/src/components/ConnectToXeroFlow/index.native.tsx index 735c4bf131a3..ab9fa3054261 100644 --- a/src/components/ConnectToXeroFlow/index.native.tsx +++ b/src/components/ConnectToXeroFlow/index.native.tsx @@ -1,6 +1,5 @@ import React, {useEffect, useRef, useState} from 'react'; -import type {OnyxEntry} from 'react-native-onyx'; -import {useOnyx, withOnyx} from 'react-native-onyx'; +import {useOnyx} from 'react-native-onyx'; import {WebView} from 'react-native-webview'; import FullPageOfflineBlockingView from '@components/BlockingViews/FullPageOfflineBlockingView'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; @@ -14,19 +13,13 @@ import Navigation from '@libs/Navigation/Navigation'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import type {Session} from '@src/types/onyx'; import type {ConnectToXeroFlowProps} from './types'; -type ConnectToXeroFlowOnyxProps = { - /** Session info for the currently logged in user. */ - session: OnyxEntry; -}; - -function ConnectToXeroFlow({policyID, session}: ConnectToXeroFlowProps & ConnectToXeroFlowOnyxProps) { +function ConnectToXeroFlow({policyID}: ConnectToXeroFlowProps) { const {translate} = useLocalize(); const webViewRef = useRef(null); const [isWebViewOpen, setWebViewOpen] = useState(false); - + const [session] = useOnyx(ONYXKEYS.SESSION); const authToken = session?.authToken ?? null; const [account] = useOnyx(ONYXKEYS.ACCOUNT); @@ -51,7 +44,6 @@ function ConnectToXeroFlow({policyID, session}: ConnectToXeroFlowProps & Connect { setIsRequire2FAModalOpen(false); - Navigation.dismissModal(); Navigation.navigate(ROUTES.SETTINGS_2FA.getRoute(ROUTES.POLICY_ACCOUNTING.getRoute(policyID), getXeroSetupLink(policyID))); }} onCancel={() => setIsRequire2FAModalOpen(false)} @@ -91,8 +83,4 @@ function ConnectToXeroFlow({policyID, session}: ConnectToXeroFlowProps & Connect ConnectToXeroFlow.displayName = 'ConnectToXeroFlow'; -export default withOnyx({ - session: { - key: ONYXKEYS.SESSION, - }, -})(ConnectToXeroFlow); +export default ConnectToXeroFlow; diff --git a/src/components/ConnectToXeroFlow/index.tsx b/src/components/ConnectToXeroFlow/index.tsx index 0a3403be78ec..5d0e88e1512b 100644 --- a/src/components/ConnectToXeroFlow/index.tsx +++ b/src/components/ConnectToXeroFlow/index.tsx @@ -34,7 +34,6 @@ function ConnectToXeroFlow({policyID}: ConnectToXeroFlowProps) { { setIsRequire2FAModalOpen(false); - Navigation.dismissModal(); Navigation.navigate(ROUTES.SETTINGS_2FA.getRoute(ROUTES.POLICY_ACCOUNTING.getRoute(policyID), getXeroSetupLink(policyID))); }} onCancel={() => {