Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function getReportsToDisplayInLHN(
const reportsToDisplay: ReportsToDisplayInLHN = {};

Object.entries(allReportsDictValues).forEach(([reportID, report]) => {
if (!report?.reportID) {
if (!report) {
return;
}

Expand Down Expand Up @@ -295,7 +295,7 @@ function updateReportsToDisplayInLHN({
const displayedReportsCopy = {...displayedReports};
updatedReportsKeys.forEach((reportID) => {
const report = reports?.[reportID];
if (!report?.reportID) {
if (!report) {
return;
}

Expand Down
9 changes: 1 addition & 8 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ import {
getReportOfflinePendingActionAndErrors,
getReportTransactions,
isAdminRoom,
isAnnounceRoom,
isChatThread,
isConciergeChatReport,
isGroupChat,
Expand Down Expand Up @@ -662,13 +661,7 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
const prevOnyxReportID = prevReport?.reportID;
const wasReportRemoved = !!prevOnyxReportID && prevOnyxReportID === reportIDFromRoute && !onyxReportID;
const isRemovalExpectedForReportType =
isEmpty(report) &&
(isMoneyRequest(prevReport) ||
isMoneyRequestReport(prevReport) ||
isPolicyExpenseChat(prevReport) ||
isGroupChat(prevReport) ||
isAdminRoom(prevReport) ||
isAnnounceRoom(prevReport));
isEmpty(report) && (isMoneyRequest(prevReport) || isMoneyRequestReport(prevReport) || isPolicyExpenseChat(prevReport) || isGroupChat(prevReport) || isAdminRoom(prevReport));
const didReportClose = wasReportRemoved && prevReport.statusNum === CONST.REPORT.STATUS_NUM.OPEN && report?.statusNum === CONST.REPORT.STATUS_NUM.CLOSED;
const isTopLevelPolicyRoomWithNoStatus = !report?.statusNum && !prevReport?.parentReportID && prevReport?.chatType === CONST.REPORT.CHAT_TYPE.POLICY_ROOM;
const isClosedTopLevelPolicyRoom = wasReportRemoved && prevReport.statusNum === CONST.REPORT.STATUS_NUM.OPEN && isTopLevelPolicyRoomWithNoStatus;
Expand Down
Loading