File tree 1 file changed +9
-1
lines changed
src/components/SelectionList/Search
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import useTheme from '@hooks/useTheme';
11
11
import useThemeStyles from '@hooks/useThemeStyles' ;
12
12
import Navigation from '@libs/Navigation/Navigation' ;
13
13
import variables from '@styles/variables' ;
14
+ import CONST from '@src/CONST' ;
14
15
import ONYXKEYS from '@src/ONYXKEYS' ;
15
16
import ROUTES from '@src/ROUTES' ;
16
17
import ReportListItemHeader from './ReportListItemHeader' ;
@@ -59,7 +60,14 @@ function ReportListItem<TItem extends ListItem>({
59
60
const openReportInRHP = ( transactionItem : TransactionListItemType ) => {
60
61
const backTo = Navigation . getActiveRoute ( ) ;
61
62
62
- Navigation . navigate ( ROUTES . SEARCH_REPORT . getRoute ( { reportID : transactionItem . transactionThreadReportID , backTo} ) ) ;
63
+ const isFromSelfDM = transactionItem . reportID === CONST . REPORT . UNREPORTED_REPORT_ID ;
64
+
65
+ const reportID =
66
+ ( ! transactionItem . isFromOneTransactionReport || isFromSelfDM ) && transactionItem . transactionThreadReportID !== CONST . REPORT . UNREPORTED_REPORT_ID
67
+ ? transactionItem . transactionThreadReportID
68
+ : transactionItem . reportID ;
69
+
70
+ Navigation . navigate ( ROUTES . SEARCH_REPORT . getRoute ( { reportID, backTo} ) ) ;
63
71
} ;
64
72
65
73
if ( ! reportItem ?. reportName && reportItem . transactions . length > 1 ) {
You can’t perform that action at this time.
0 commit comments