11import { hasSeenTourSelector } from '@selectors/Onboarding' ;
22import React from 'react' ;
3+ import type { OnyxEntry } from 'react-native-onyx' ;
34import MenuItem from '@components/MenuItem' ;
45import ScrollView from '@components/ScrollView' ;
56import Section from '@components/Section' ;
@@ -18,7 +19,7 @@ import CONST from '@src/CONST';
1819import ONYXKEYS from '@src/ONYXKEYS' ;
1920import ROUTES from '@src/ROUTES' ;
2021import type { Route } from '@src/ROUTES' ;
21- import type { ReimbursementAccount } from '@src/types/onyx' ;
22+ import type { Policy , ReimbursementAccount } from '@src/types/onyx' ;
2223import Enable2FACard from './Enable2FACard' ;
2324
2425type FinishChatCardProps = {
@@ -28,14 +29,17 @@ type FinishChatCardProps = {
2829 /** Boolean required to display Enable2FACard component */
2930 requiresTwoFactorAuth : boolean ;
3031
32+ /** The policy which the user has access to and which the report is tied to */
33+ policy : OnyxEntry < Policy > ;
34+
3135 /** Method to set the state of USD bank account step */
3236 setUSDBankAccountStep ?: ( step : string | null ) => void ;
3337
3438 /** Route to return to when navigating back out of the flow */
3539 backTo ?: Route ;
3640} ;
3741
38- function FinishChatCard ( { requiresTwoFactorAuth, reimbursementAccount, setUSDBankAccountStep, backTo} : FinishChatCardProps ) {
42+ function FinishChatCard ( { requiresTwoFactorAuth, reimbursementAccount, policy , setUSDBankAccountStep, backTo} : FinishChatCardProps ) {
3943 const { translate} = useLocalize ( ) ;
4044 const styles = useThemeStyles ( ) ;
4145 const { shouldUseNarrowLayout} = useResponsiveLayout ( ) ;
@@ -86,7 +90,7 @@ function FinishChatCard({requiresTwoFactorAuth, reimbursementAccount, setUSDBank
8690 goToWithdrawalAccountSetupStep ( CONST . BANK_ACCOUNT . STEP . REQUESTOR ) ;
8791 Navigation . navigate (
8892 ROUTES . BANK_ACCOUNT_USD_SETUP . getRoute ( {
89- policyID,
93+ policyID : policy ?. id ,
9094 page : CONST . BANK_ACCOUNT . PAGE_NAMES . REQUESTOR ,
9195 subPage : CONST . BANK_ACCOUNT . PERSONAL_INFO_STEP . SUB_PAGE_NAMES . FULL_NAME ,
9296 backTo,
0 commit comments