@@ -55,6 +55,7 @@ function KYCWall({
5555 const [ bankAccountList = getEmptyObject < BankAccountList > ( ) ] = useOnyx ( ONYXKEYS . BANK_ACCOUNT_LIST , { canBeMissing : true } ) ;
5656 const [ reimbursementAccount ] = useOnyx ( ONYXKEYS . REIMBURSEMENT_ACCOUNT , { canBeMissing : true } ) ;
5757 const [ chatReport ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ chatReportID } ` , { canBeMissing : true } ) ;
58+ const [ allReports ] = useOnyx ( ONYXKEYS . COLLECTION . REPORT , { canBeMissing : true } ) ;
5859
5960 const { formatPhoneNumber} = useLocalize ( ) ;
6061
@@ -121,7 +122,7 @@ function KYCWall({
121122 } else if ( paymentMethod === CONST . PAYMENT_METHODS . BUSINESS_BANK_ACCOUNT || policy ) {
122123 if ( iouReport && isIOUReport ( iouReport ) ) {
123124 if ( policy ) {
124- const policyExpenseChatReportID = getPolicyExpenseChat ( iouReport . ownerAccountID , policy . id ) ?. reportID ;
125+ const policyExpenseChatReportID = getPolicyExpenseChat ( iouReport . ownerAccountID , policy . id , allReports ) ?. reportID ;
125126 if ( ! policyExpenseChatReportID ) {
126127 const { policyExpenseChatReportID : newPolicyExpenseChatReportID } = moveIOUReportToPolicyAndInviteSubmitter ( iouReport . reportID , policy . id , formatPhoneNumber ) ?? { } ;
127128 savePreferredPaymentMethod ( iouReport . policyID , policy . id , CONST . LAST_PAYMENT_METHOD . IOU , lastPaymentMethod ?. [ policy . id ] ) ;
@@ -157,7 +158,7 @@ function KYCWall({
157158 Navigation . navigate ( bankAccountRoute ) ;
158159 }
159160 } ,
160- [ addBankAccountRoute , addDebitCardRoute , chatReport , iouReport , onSelectPaymentMethod , formatPhoneNumber , lastPaymentMethod ] ,
161+ [ addBankAccountRoute , addDebitCardRoute , chatReport , iouReport , onSelectPaymentMethod , formatPhoneNumber , lastPaymentMethod , allReports ] ,
161162 ) ;
162163
163164 /**
0 commit comments