@@ -9,7 +9,6 @@ import useThemeStyles from '@hooks/useThemeStyles';
9
9
import useWindowDimensions from '@hooks/useWindowDimensions' ;
10
10
import Navigation from '@libs/Navigation/Navigation' ;
11
11
import * as ReportActionsUtils from '@libs/ReportActionsUtils' ;
12
- import * as ReportUtils from '@libs/ReportUtils' ;
13
12
import * as TransactionUtils from '@libs/TransactionUtils' ;
14
13
import variables from '@styles/variables' ;
15
14
import * as IOU from '@userActions/IOU' ;
@@ -58,15 +57,11 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
58
57
const theme = useTheme ( ) ;
59
58
const { translate} = useLocalize ( ) ;
60
59
const [ shouldShowHoldMenu , setShouldShowHoldMenu ] = useState ( false ) ;
61
- const isSelfDMTrackExpenseReport = ReportUtils . isTrackExpenseReport ( report ) && ReportUtils . isSelfDM ( parentReport ) ;
62
- const moneyRequestReport = ! isSelfDMTrackExpenseReport ? parentReport : undefined ;
63
- const isDraft = ReportUtils . isOpenExpenseReport ( moneyRequestReport ) ;
64
60
const isOnHold = TransactionUtils . isOnHold ( transaction ) ;
65
61
const isDuplicate = TransactionUtils . isDuplicate ( transaction ?. transactionID ?? '' ) ;
66
62
const { isSmallScreenWidth} = useWindowDimensions ( ) ;
67
63
68
64
const hasAllPendingRTERViolations = TransactionUtils . allHavePendingRTERViolation ( [ transaction ?. transactionID ?? '-1' ] ) ;
69
- const shouldShowMarkAsCashButton = isDraft && hasAllPendingRTERViolations ;
70
65
71
66
const markAsCash = useCallback ( ( ) => {
72
67
TransactionActions . markAsCash ( transaction ?. transactionID ?? '-1' , report . reportID ) ;
@@ -142,7 +137,7 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
142
137
shouldShowBackButton = { shouldUseNarrowLayout }
143
138
onBackButtonPress = { onBackButtonPress }
144
139
>
145
- { shouldShowMarkAsCashButton && ! shouldUseNarrowLayout && (
140
+ { hasAllPendingRTERViolations && ! shouldUseNarrowLayout && (
146
141
< Button
147
142
success
148
143
medium
@@ -163,7 +158,7 @@ function MoneyRequestHeader({report, parentReportAction, policy, shouldUseNarrow
163
158
/>
164
159
) }
165
160
</ HeaderWithBackButton >
166
- { shouldShowMarkAsCashButton && shouldUseNarrowLayout && (
161
+ { hasAllPendingRTERViolations && shouldUseNarrowLayout && (
167
162
< View style = { [ styles . ph5 , styles . pb3 ] } >
168
163
< Button
169
164
medium
0 commit comments