diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index b01c1b214f040..ba35de3c9efbd 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -64,6 +64,7 @@ import { hasViolations as hasViolationsReportUtils, isAllowedToApproveExpenseReport, isCurrentUserSubmitter, + isDM, isExported as isExportedUtils, isInvoiceReport as isInvoiceReportUtil, isProcessingReport, @@ -422,6 +423,7 @@ function MoneyReportHeader({ const shouldDisplaySearchRouter = !isReportInRHP || isSmallScreenWidth; const isReportInSearch = route.name === SCREENS.SEARCH.MONEY_REQUEST_REPORT; const isReportSubmitter = isCurrentUserSubmitter(chatIOUReport); + const isChatReportDM = isDM(chatReport); const existingB2BInvoiceReport = useParticipantsInvoiceReport(activePolicyID, CONST.REPORT.INVOICE_RECEIVER_TYPE.BUSINESS, chatReport?.policyID); const confirmPayment = useCallback( @@ -1038,7 +1040,7 @@ function MoneyReportHeader({ const isDismissed = isReportSubmitter ? dismissedHoldUseExplanation : dismissedRejectUseExplanation; - if (isDismissed) { + if (isDismissed || isChatReportDM) { changeMoneyRequestHoldStatus(requestParentReportAction); } else if (isReportSubmitter) { setIsHoldEducationalModalVisible(true); diff --git a/src/components/MoneyRequestHeader.tsx b/src/components/MoneyRequestHeader.tsx index 17d945002dfd9..1709fe77b8735 100644 --- a/src/components/MoneyRequestHeader.tsx +++ b/src/components/MoneyRequestHeader.tsx @@ -26,7 +26,7 @@ import type {ReportsSplitNavigatorParamList, SearchReportParamList} from '@libs/ import {getOriginalMessage, isMoneyRequestAction, isTrackExpenseAction} from '@libs/ReportActionsUtils'; import {getTransactionThreadPrimaryAction, isMarkAsResolvedAction} from '@libs/ReportPrimaryActionUtils'; import {getSecondaryTransactionThreadActions} from '@libs/ReportSecondaryActionUtils'; -import {changeMoneyRequestHoldStatus, isCurrentUserSubmitter, isSelfDM, navigateToDetailsPage, rejectMoneyRequestReason} from '@libs/ReportUtils'; +import {changeMoneyRequestHoldStatus, isCurrentUserSubmitter, isDM, isSelfDM, navigateToDetailsPage, rejectMoneyRequestReason} from '@libs/ReportUtils'; import {getReviewNavigationRoute} from '@libs/TransactionPreviewUtils'; import { getOriginalTransactionWithSplitInfo, @@ -132,6 +132,7 @@ function MoneyRequestHeader({report, parentReportAction, policy, onBackButtonPre const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationTransactionUtils(parentReport, policy, transactionViolations); const isReportSubmitter = isCurrentUserSubmitter(chatIOUReport); + const isParentReportDM = isDM(parentReport); // If the parent report is a selfDM, it should always be opened in the Inbox tab const shouldOpenParentReportInCurrentTab = !isSelfDM(parentReport); @@ -306,7 +307,7 @@ function MoneyRequestHeader({report, parentReportAction, policy, onBackButtonPre const isDismissed = isReportSubmitter ? dismissedHoldUseExplanation : dismissedRejectUseExplanation; - if (isDismissed) { + if (isDismissed || isParentReportDM) { changeMoneyRequestHoldStatus(parentReportAction); } else if (isReportSubmitter) { setIsHoldEducationalModalVisible(true);