From f3705e4892a7d172d9e698f468e3e36f9d5f10c3 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 17 Jul 2024 14:23:21 +0800 Subject: [PATCH 1/3] fix empty transaction details shows after deleting the last comment on a deleted transaction thread --- src/pages/home/report/ReportActionItemContentCreated.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItemContentCreated.tsx b/src/pages/home/report/ReportActionItemContentCreated.tsx index c34cf3991900..776ea8aeea02 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) { From 51683ca1b95fcb36288ce55bbce13831dcc24f1f Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 17 Jul 2024 14:23:54 +0800 Subject: [PATCH 2/3] navigate back to parent report when the last comment of a deleted thread is deleted --- src/pages/home/ReportScreen.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index 49897928ffe9..afc8b13eea1d 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 From e4cd7c69aeba728d1079b1bf6c422670f8175263 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 17 Jul 2024 14:54:48 +0800 Subject: [PATCH 3/3] add missing deps --- src/pages/home/ReportScreen.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index afc8b13eea1d..69cec11208ea 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -587,6 +587,8 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro prevReport, reportIDFromRoute, isFocused, + isDeletedParentAction, + prevIsDeletedParentAction, ]); useEffect(() => {