@@ -86,6 +86,7 @@ import ROUTES from '@src/ROUTES';
8686import SCREENS from '@src/SCREENS' ;
8787import type * as OnyxTypes from '@src/types/onyx' ;
8888import type { PaymentMethodType } from '@src/types/onyx/OriginalMessage' ;
89+ import getEmptyArray from '@src/types/utils/getEmptyArray' ;
8990import type IconAsset from '@src/types/utils/IconAsset' ;
9091import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue' ;
9192import BrokenConnectionDescription from './BrokenConnectionDescription' ;
@@ -168,15 +169,14 @@ function MoneyReportHeader({
168169 }
169170 return reportActions . find ( ( action ) : action is OnyxTypes . ReportAction < typeof CONST . REPORT . ACTIONS . TYPE . IOU > => action . reportActionID === transactionThreadReport . parentReportActionID ) ;
170171 } , [ reportActions , transactionThreadReport ?. parentReportActionID ] ) ;
171- const [ transactions = [ ] ] = useOnyx ( ONYXKEYS . COLLECTION . TRANSACTION , {
172+ const [ transactions = getEmptyArray < OnyxTypes . Transaction > ( ) ] = useOnyx ( ONYXKEYS . COLLECTION . TRANSACTION , {
172173 selector : ( _transactions ) => reportTransactionsSelector ( _transactions , moneyRequestReport ?. reportID ) ,
173- initialValue : [ ] ,
174174 canBeMissing : true ,
175175 } ) ;
176176 const [ transaction ] = useOnyx ( `${ ONYXKEYS . COLLECTION . TRANSACTION } ${ isMoneyRequestAction ( requestParentReportAction ) && getOriginalMessage ( requestParentReportAction ) ?. IOUTransactionID } ` , {
177177 canBeMissing : true ,
178178 } ) ;
179- const [ dismissedHoldUseExplanation , dismissedHoldUseExplanationResult ] = useOnyx ( ONYXKEYS . NVP_DISMISSED_HOLD_USE_EXPLANATION , { initialValue : true , canBeMissing : true } ) ;
179+ const [ dismissedHoldUseExplanation , dismissedHoldUseExplanationResult ] = useOnyx ( ONYXKEYS . NVP_DISMISSED_HOLD_USE_EXPLANATION , { canBeMissing : true } ) ;
180180 const isLoadingHoldUseExplained = isLoadingOnyxValue ( dismissedHoldUseExplanationResult ) ;
181181 const [ invoiceReceiverPolicy ] = useOnyx (
182182 `${ ONYXKEYS . COLLECTION . POLICY } ${ chatReport ?. invoiceReceiver && 'policyID' in chatReport . invoiceReceiver ? chatReport . invoiceReceiver . policyID : undefined } ` ,
0 commit comments