diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index 49897928ffe94..69cec11208ea3 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -133,6 +133,8 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const wasLoadingApp = usePrevious(isLoadingApp); const finishedLoadingApp = wasLoadingApp && !isLoadingApp; + const isDeletedParentAction = ReportActionsUtils.isDeletedParentAction(parentReportAction); + const prevIsDeletedParentAction = usePrevious(isDeletedParentAction); const isLoadingReportOnyx = isLoadingOnyxValue(reportResult); const permissions = useDeepCompareRef(reportOnyx?.permissions); @@ -534,7 +536,8 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro (!prevUserLeavingStatus && !!userLeavingStatus) || didReportClose || isRemovalExpectedForReportType || - isClosedTopLevelPolicyRoom + isClosedTopLevelPolicyRoom || + (prevIsDeletedParentAction && !isDeletedParentAction) ) { // Early return if the report we're passing isn't in a focused state. We only want to navigate to Concierge if the user leaves the room from another device or gets removed from the room while the report is in a focused state. // Prevent auto navigation for report in RHP @@ -584,6 +587,8 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro prevReport, reportIDFromRoute, isFocused, + isDeletedParentAction, + prevIsDeletedParentAction, ]); useEffect(() => { diff --git a/src/pages/home/report/ReportActionItemContentCreated.tsx b/src/pages/home/report/ReportActionItemContentCreated.tsx index c34cf39919007..776ea8aeea029 100644 --- a/src/pages/home/report/ReportActionItemContentCreated.tsx +++ b/src/pages/home/report/ReportActionItemContentCreated.tsx @@ -75,7 +75,7 @@ function ReportActionItemContentCreated({contextValue, parentReportAction, trans if (ReportActionsUtils.isTransactionThread(parentReportAction)) { const isReversedTransaction = ReportActionsUtils.isReversedTransaction(parentReportAction); - if (ReportActionsUtils.isDeletedParentAction(parentReportAction) || isReversedTransaction) { + if (ReportActionsUtils.isMessageDeleted(parentReportAction) || isReversedTransaction) { let message: TranslationPaths; if (isReversedTransaction) {