@@ -21,15 +21,16 @@ type TransactionReceiptProps = PlatformStackScreenProps<AuthScreensParamList, ty
2121function TransactionReceipt ( { route} : TransactionReceiptProps ) {
2222 const reportID = route . params . reportID ;
2323 const transactionID = route . params . transactionID ;
24- const { action, iouType} = 'action' in route . params ? { action : route . params . action , iouType : route . params . iouType } : { } ;
24+ const action = 'action' in route . params ? route . params . action : undefined ;
25+ const iouType = 'iouType' in route . params ? route . params . iouType : undefined ;
2526 const [ report ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT } ${ reportID } ` , { canBeMissing : true } ) ;
2627 const [ transactionMain ] = useOnyx ( `${ ONYXKEYS . COLLECTION . TRANSACTION } ${ transactionID } ` , { canBeMissing : true } ) ;
2728 const [ transactionDraft ] = useOnyx ( `${ ONYXKEYS . COLLECTION . TRANSACTION_DRAFT } ${ transactionID } ` , { canBeMissing : true } ) ;
2829 const [ reportMetadata = CONST . DEFAULT_REPORT_METADATA ] = useOnyx ( `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` , { canBeMissing : true } ) ;
2930
3031 // If we have a merge transaction, we need to use the receipt from the merge transaction
31- const { mergeTransactionID, isFromReviewDuplicates } =
32- 'mergeTransactionID ' in route . params ? { mergeTransactionID : route . params . mergeTransactionID , isFromReviewDuplicates : route . params . isFromReviewDuplicates === 'true' } : { } ;
32+ const mergeTransactionID = 'mergeTransactionID' in route . params ? route . params . mergeTransactionID : undefined ;
33+ const isFromReviewDuplicates = 'isFromReviewDuplicates ' in route . params ? route . params . isFromReviewDuplicates === 'true' : undefined ;
3334 const [ mergeTransaction ] = useOnyx ( `${ ONYXKEYS . COLLECTION . MERGE_TRANSACTION } ${ mergeTransactionID } ` , { canBeMissing : true } ) ;
3435 if ( mergeTransactionID && mergeTransaction && transactionMain ) {
3536 transactionMain . receipt = mergeTransaction . receipt ;
0 commit comments