@@ -45,9 +45,10 @@ type Props = {
4545 selectReport : ( item : TransactionGroupListItem ) => void ;
4646 removeFromReport ?: ( ) => void ;
4747 isEditing ?: boolean ;
48+ isUnreported ?: boolean ;
4849} ;
4950
50- function IOURequestEditReportCommon ( { backTo, transactionsReports, selectReport, removeFromReport, isEditing = false } : Props ) {
51+ function IOURequestEditReportCommon ( { backTo, transactionsReports, selectReport, removeFromReport, isEditing = false , isUnreported } : Props ) {
5152 const { translate} = useLocalize ( ) ;
5253 const { options} = useOptionsList ( ) ;
5354 const [ allReports ] = useOnyx ( ONYXKEYS . COLLECTION . REPORT , { selector : ( reports ) => mapOnyxCollectionItems ( reports , reportSelector ) , canBeMissing : true } ) ;
@@ -60,6 +61,7 @@ function IOURequestEditReportCommon({backTo, transactionsReports, selectReport,
6061 const onlyReport = transactionsReports . length === 1 ? transactionsReports . at ( 0 ) : undefined ;
6162 const isOwner = onlyReport ? onlyReport . ownerAccountID === currentUserPersonalDetails . accountID : false ;
6263 const isReportIOU = onlyReport ? isIOUReport ( onlyReport ) : false ;
64+ const shouldShowRemoveFromReport = isEditing && isOwner && ! isReportIOU && ! isUnreported ;
6365
6466 const expenseReports = useMemo (
6567 ( ) =>
@@ -124,7 +126,7 @@ function IOURequestEditReportCommon({backTo, transactionsReports, selectReport,
124126 initiallyFocusedOptionKey = { transactionsReports . length === 1 ? transactionsReports . at ( 0 ) ?. reportID : undefined }
125127 ListItem = { InviteMemberListItem }
126128 listFooterContent = {
127- isEditing && isOwner && ! isReportIOU ? (
129+ shouldShowRemoveFromReport ? (
128130 < MenuItem
129131 onPress = { removeFromReport }
130132 title = { translate ( 'iou.removeFromReport' ) }
0 commit comments