@@ -15,6 +15,7 @@ import useActionLoadingReportIDs from '@hooks/useActionLoadingReportIDs';
1515import useArchivedReportsIdSet from '@hooks/useArchivedReportsIdSet' ;
1616import { useCurrencyListActions } from '@hooks/useCurrencyList' ;
1717import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails' ;
18+ import useEnvironment from '@hooks/useEnvironment' ;
1819import type { ActionHandledType } from '@hooks/useHoldMenuSubmit' ;
1920import useLocalize from '@hooks/useLocalize' ;
2021import useMultipleSnapshots from '@hooks/useMultipleSnapshots' ;
@@ -124,10 +125,11 @@ function mapTransactionItemToSelectedEntry(
124125 originalItemTransaction : OnyxEntry < Transaction > ,
125126 currentUserLogin : string ,
126127 currentUserAccountID : number ,
127- outstandingReportsByPolicyID ?: OutstandingReportsByPolicyIDDerivedValue ,
128- allowNegativeAmount = true ,
129- parentReport ?: OnyxEntry < Report > ,
130- selfDMReport ?: OnyxEntry < Report > ,
128+ outstandingReportsByPolicyID : OutstandingReportsByPolicyIDDerivedValue | undefined ,
129+ allowNegativeAmount : boolean ,
130+ parentReport : OnyxEntry < Report > | undefined ,
131+ selfDMReport : OnyxEntry < Report > | undefined ,
132+ isProduction : boolean ,
131133) : [ string , SelectedTransactionInfo ] {
132134 const { canHoldRequest, canUnholdRequest} = canHoldUnholdReportAction ( item . report , item . reportAction , item . holdReportAction , item , item . policy , currentUserAccountID ) ;
133135 const canRejectRequest = item . report ? canRejectReportAction ( currentUserLogin , item . report ) : false ;
@@ -144,7 +146,7 @@ function mapTransactionItemToSelectedEntry(
144146 canHold : canHoldRequest ,
145147 isHeld : isOnHold ( item ) ,
146148 canUnhold : canUnholdRequest ,
147- canSplit : isSplitAction ( reportForSplit , [ itemTransaction ] , originalItemTransaction , currentUserLogin , currentUserAccountID , item . policy , parentReport ) ,
149+ canSplit : isSplitAction ( reportForSplit , [ itemTransaction ] , originalItemTransaction , currentUserLogin , currentUserAccountID , item . policy , parentReport , isProduction ) ,
148150 hasBeenSplit : getOriginalTransactionWithSplitInfo ( itemTransaction , originalItemTransaction ) . isExpenseSplit ,
149151 canChangeReport : canEditFieldOfMoneyRequest ( {
150152 reportAction : item . reportAction ,
@@ -200,9 +202,10 @@ function prepareTransactionsList(
200202 selectedTransactions : SelectedTransactions ,
201203 currentUserLogin : string ,
202204 currentUserAccountID : number ,
203- outstandingReportsByPolicyID ?: OutstandingReportsByPolicyIDDerivedValue ,
204- parentReport ?: OnyxEntry < Report > ,
205- selfDMReport ?: OnyxEntry < Report > ,
205+ outstandingReportsByPolicyID : OutstandingReportsByPolicyIDDerivedValue | undefined ,
206+ parentReport : OnyxEntry < Report > | undefined ,
207+ selfDMReport : OnyxEntry < Report > | undefined ,
208+ isProduction : boolean ,
206209) {
207210 if ( selectedTransactions [ item . keyForList ] ?. isSelected ) {
208211 const { [ item . keyForList ] : omittedTransaction , ...transactions } = selectedTransactions ;
@@ -220,6 +223,7 @@ function prepareTransactionsList(
220223 false ,
221224 parentReport ,
222225 selfDMReport ,
226+ isProduction ,
223227 ) ;
224228
225229 return {
@@ -244,6 +248,7 @@ function Search({
244248 const { type, status, sortBy, sortOrder, hash, similarSearchHash, groupBy, view} = queryJSON ;
245249
246250 const { isOffline} = useNetwork ( ) ;
251+ const { isProduction} = useEnvironment ( ) ;
247252 const prevIsOffline = usePrevious ( isOffline ) ;
248253 // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
249254 const { shouldUseNarrowLayout, isSmallScreenWidth, isLargeScreenWidth, isInLandscapeMode} = useResponsiveLayout ( ) ;
@@ -806,7 +811,7 @@ function Search({
806811 canHold : canHoldRequest ,
807812 isHeld : isOnHold ( transactionItem ) ,
808813 canUnhold : canUnholdRequest ,
809- canSplit : isSplitAction ( reportForSplit , [ itemTransaction ] , originalItemTransaction , login ?? '' , accountID , transactionItem . policy , itemParentReport ) ,
814+ canSplit : isSplitAction ( reportForSplit , [ itemTransaction ] , originalItemTransaction , login ?? '' , accountID , transactionItem . policy , itemParentReport , isProduction ) ,
810815 hasBeenSplit : getOriginalTransactionWithSplitInfo ( itemTransaction , originalItemTransaction ) . isExpenseSplit ,
811816 canChangeReport : canEditFieldOfMoneyRequest ( {
812817 reportAction : transactionItem . reportAction ,
@@ -865,7 +870,7 @@ function Search({
865870 canHold : canHoldRequest ,
866871 isHeld : isOnHold ( transactionItem ) ,
867872 canUnhold : canUnholdRequest ,
868- canSplit : isSplitAction ( reportForSplit , [ itemTransaction ] , originalItemTransaction , login ?? '' , accountID , transactionItem . policy , itemParentReport ) ,
873+ canSplit : isSplitAction ( reportForSplit , [ itemTransaction ] , originalItemTransaction , login ?? '' , accountID , transactionItem . policy , itemParentReport , isProduction ) ,
869874 hasBeenSplit : getOriginalTransactionWithSplitInfo ( itemTransaction , originalItemTransaction ) . isExpenseSplit ,
870875 canChangeReport : canEditFieldOfMoneyRequest ( {
871876 reportAction : transactionItem . reportAction ,
@@ -1032,6 +1037,7 @@ function Search({
10321037 outstandingReportsByPolicyID ,
10331038 itemParentReport ,
10341039 selfDMReport ,
1040+ isProduction ,
10351041 ) ;
10361042 setSelectedTransactions ( updatedTransactions ) ;
10371043 updateSelectAllMatchingItemsState ( updatedTransactions ) ;
@@ -1108,14 +1114,26 @@ function Search({
11081114 true ,
11091115 itemParentReport ,
11101116 selfDMReport ,
1117+ isProduction ,
11111118 ) ;
11121119 } ) ,
11131120 ) ,
11141121 } ;
11151122 setSelectedTransactions ( updatedTransactions ) ;
11161123 updateSelectAllMatchingItemsState ( updatedTransactions ) ;
11171124 } ,
1118- [ selectedTransactions , setSelectedTransactions , updateSelectAllMatchingItemsState , transactions , email , accountID , outstandingReportsByPolicyID , searchResults ?. data , selfDMReport ] ,
1125+ [
1126+ selectedTransactions ,
1127+ setSelectedTransactions ,
1128+ updateSelectAllMatchingItemsState ,
1129+ transactions ,
1130+ searchResults ?. data ,
1131+ email ,
1132+ accountID ,
1133+ outstandingReportsByPolicyID ,
1134+ selfDMReport ,
1135+ isProduction ,
1136+ ] ,
11191137 ) ;
11201138
11211139 const onSelectRowInMobileSelectionMode = ( item : SearchListItem ) => {
@@ -1429,6 +1447,7 @@ function Search({
14291447 true ,
14301448 itemParentReport ,
14311449 selfDMReport ,
1450+ isProduction ,
14321451 ) ;
14331452 } ) ;
14341453 } ) ;
@@ -1452,6 +1471,7 @@ function Search({
14521471 true ,
14531472 itemParentReport ,
14541473 selfDMReport ,
1474+ isProduction ,
14551475 ) ;
14561476 } ) ,
14571477 ) ;
@@ -1471,6 +1491,7 @@ function Search({
14711491 outstandingReportsByPolicyID ,
14721492 searchResults ?. data ,
14731493 selfDMReport ,
1494+ isProduction ,
14741495 ] ) ;
14751496
14761497 const onLayoutBase = useCallback ( ( ) => {
0 commit comments