Skip to content

Commit

Permalink
Merge pull request #29068 from ZhenjaHorbach/delete-request-pop-up-do…
Browse files Browse the repository at this point in the history
…es-not-close

Delete request pop-up does not close when requestee pays the money request
  • Loading branch information
MonilBhavsar authored Oct 10, 2023
2 parents f8ed016 + 2472b0b commit 562f9d8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/MoneyRequestHeader.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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 (
<>
<View style={[styles.pl0]}>
<HeaderWithBackButton
shouldShowAvatarWithDisplay
shouldShowPinButton={false}
shouldShowThreeDotsButton={isActionOwner && !isSettled && !isApproved}
shouldShowThreeDotsButton={canModifyRequest}
threeDotsMenuItems={[
...(TransactionUtils.hasReceipt(transaction)
? []
Expand Down

0 comments on commit 562f9d8

Please sign in to comment.