diff --git a/src/components/MoneyRequestHeader.js b/src/components/MoneyRequestHeader.js index 7117f67a29b0..8a2005e64c22 100644 --- a/src/components/MoneyRequestHeader.js +++ b/src/components/MoneyRequestHeader.js @@ -1,4 +1,4 @@ -import React, {useState, useCallback} from 'react'; +import React, {useState, useCallback, useEffect} from 'react'; import {withOnyx} from 'react-native-onyx'; import {View} from 'react-native'; import PropTypes from 'prop-types'; @@ -81,13 +81,23 @@ function MoneyRequestHeader({session, parentReport, report, parentReportAction, const isScanning = TransactionUtils.hasReceipt(transaction) && TransactionUtils.isReceiptBeingScanned(transaction); + const canModifyRequest = isActionOwner && !isSettled && !isApproved; + + useEffect(() => { + if (canModifyRequest) { + return; + } + + setIsDeleteModalVisible(false); + }, [canModifyRequest]); + return ( <>