Skip to content

Commit

Permalink
Merge pull request #45563 from bernhardoj/fix/43930-navigate-back-to-…
Browse files Browse the repository at this point in the history
…parent-after-deleting-last-comment-of-thread
  • Loading branch information
francoisl committed Jul 18, 2024
2 parents 347929d + e4cd7c6 commit d8dcbd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ function ReportScreen({
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);
Expand Down Expand Up @@ -556,7 +558,8 @@ function ReportScreen({
(!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
Expand Down Expand Up @@ -606,6 +609,8 @@ function ReportScreen({
prevReport,
reportIDFromRoute,
isFocused,
isDeletedParentAction,
prevIsDeletedParentAction,
]);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItemContentCreated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d8dcbd2

Please sign in to comment.