@@ -16,19 +16,20 @@ import ONYXKEYS from '@src/ONYXKEYS';
1616import ROUTES from '@src/ROUTES' ;
1717import type SCREENS from '@src/SCREENS' ;
1818
19- type TransactionReceiptProps = PlatformStackScreenProps < AuthScreensParamList , typeof SCREENS . TRANSACTION_RECEIPT > ;
19+ type TransactionReceiptProps = PlatformStackScreenProps < AuthScreensParamList , typeof SCREENS . TRANSACTION_RECEIPT | typeof SCREENS . MONEY_REQUEST . RECEIPT_PREVIEW > ;
2020
2121function TransactionReceipt ( { route} : TransactionReceiptProps ) {
2222 const reportID = route . params . reportID ;
2323 const transactionID = route . params . transactionID ;
24- const action = route . params . action ;
24+ const { action, iouType } = 'action' in route . params ? { action : route . params . action , iouType : route . params . iouType } : { } ;
2525 const [ report ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ reportID } ` , { canBeMissing : true } ) ;
2626 const [ transactionMain ] = useOnyx ( `${ ONYXKEYS . COLLECTION . TRANSACTION } ${ transactionID } ` , { canBeMissing : true } ) ;
2727 const [ transactionDraft ] = useOnyx ( `${ ONYXKEYS . COLLECTION . TRANSACTION_DRAFT } ${ transactionID } ` , { canBeMissing : true } ) ;
2828 const [ reportMetadata = CONST . DEFAULT_REPORT_METADATA ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` , { canBeMissing : true } ) ;
2929
3030 // If we have a merge transaction, we need to use the receipt from the merge transaction
31- const mergeTransactionID = route . params . mergeTransactionID ;
31+ const { mergeTransactionID, isFromReviewDuplicates} =
32+ 'mergeTransactionID' in route . params ? { mergeTransactionID : route . params . mergeTransactionID , isFromReviewDuplicates : route . params . isFromReviewDuplicates === 'true' } : { } ;
3233 const [ mergeTransaction ] = useOnyx ( `${ ONYXKEYS . COLLECTION . MERGE_TRANSACTION } ${ mergeTransactionID } ` , { canBeMissing : true } ) ;
3334 if ( mergeTransactionID && mergeTransaction && transactionMain ) {
3435 transactionMain . receipt = mergeTransaction . receipt ;
@@ -39,15 +40,13 @@ function TransactionReceipt({route}: TransactionReceiptProps) {
3940 const receiptURIs = getThumbnailAndImageURIs ( transaction ) ;
4041 const isLocalFile = receiptURIs . isLocalFile ;
4142 const readonly = route . params . readonly === 'true' ;
42- const isFromReviewDuplicates = route . params . isFromReviewDuplicates === 'true' ;
4343 const imageSource = isDraftTransaction ? transactionDraft ?. receipt ?. source : tryResolveUrlFromApiRoot ( receiptURIs . image ?? '' ) ;
4444
4545 const parentReportAction = getReportAction ( report ?. parentReportID , report ?. parentReportActionID ) ;
4646 const canEditReceipt = canEditFieldOfMoneyRequest ( parentReportAction , CONST . EDIT_REQUEST_FIELD . RECEIPT ) ;
4747 const canDeleteReceipt = canEditFieldOfMoneyRequest ( parentReportAction , CONST . EDIT_REQUEST_FIELD . RECEIPT , true ) ;
4848 const isEReceipt = transaction && ! hasReceiptSource ( transaction ) && hasEReceipt ( transaction ) ;
4949 const isTrackExpenseAction = isTrackExpenseReportReportActionsUtils ( parentReportAction ) ;
50- const iouType = route . params . iouType ;
5150
5251 useEffect ( ( ) => {
5352 if ( ( ! ! report && ! ! transaction ) || isDraftTransaction ) {
0 commit comments