Skip to content

Commit

Permalink
Fix Delete request pop-up does not close when requestee pays the mone…
Browse files Browse the repository at this point in the history
…y request
  • Loading branch information
ZhenjaHorbach committed Oct 9, 2023
1 parent 389d7b0 commit b035e39
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 @@ -80,13 +80,23 @@ function MoneyRequestHeader({session, parentReport, report, parentReportAction,

const isScanning = TransactionUtils.hasReceipt(transaction) && TransactionUtils.isReceiptBeingScanned(transaction);

const shouldShowThreeDotsButton = isActionOwner && !isSettled && !isApproved;

useEffect(() => {
if (shouldShowThreeDotsButton) {
return;
}

setIsDeleteModalVisible(false);
}, [shouldShowThreeDotsButton]);

return (
<>
<View style={[styles.pl0]}>
<HeaderWithBackButton
shouldShowAvatarWithDisplay
shouldShowPinButton={false}
shouldShowThreeDotsButton={isActionOwner && !isSettled && !isApproved}
shouldShowThreeDotsButton={shouldShowThreeDotsButton}
threeDotsMenuItems={[
...(TransactionUtils.hasReceipt(transaction)
? []
Expand Down

0 comments on commit b035e39

Please sign in to comment.