Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/libs/actions/Report/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3132,6 +3132,16 @@ function deleteReportComment(
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(reportID));
} else if (Navigation.isActiveRoute(ROUTES.REPORT_WITH_ID.getRoute(reportAction.childReportID)) && !isDeletedParentAction) {
Navigation.goBack(undefined);
} else if (
// When this report is the one currently displayed at the top of the search RHP (/search/view/:reportID) and
// deleting this comment leaves it without any visible actions, pop just this RHP screen so we don't show an empty
// report. We use goBack (not dismissModal) so any wider RHP screens stacked below remain open. Deleted parent
// messages stay visible as a "[Deleted message]" placeholder, so we skip closing in that case.
Navigation.getTopmostSearchReportID() === reportID &&
!isDeletedParentAction &&
!ReportActionsUtils.doesReportHaveVisibleActions(reportID, canUserPerformWriteAction, optimisticReportActions as ReportActions, visibleReportActionsDataParam)
) {
Navigation.goBack();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/inbox/report/ReportActionItemFragment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function ReportActionItemFragment({
case 'OLD_MESSAGE':
return <Text>OLD_MESSAGE</Text>;
default:
return <Text>fragment.text</Text>;
return <Text>{fragment?.text ?? ''}</Text>;
}
}

Expand Down
Loading