From b035e395317818cb75030a3418868e90716d80b6 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Mon, 9 Oct 2023 10:47:36 +0200 Subject: [PATCH] Fix Delete request pop-up does not close when requestee pays the money request --- src/components/MoneyRequestHeader.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/MoneyRequestHeader.js b/src/components/MoneyRequestHeader.js index 493184c159e0..55c7fcd36f4d 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'; @@ -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 ( <>