Skip to content

Commit cf93ba9

Browse files
authored
Merge pull request Expensify#67612 from mkzie2/mkzie2-issue/67099
fix: remove call to getReportNameValuePairs() in method reasonForReportToBeInOptionList
2 parents 6782a29 + 41b9030 commit cf93ba9

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

src/libs/ReportUtils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8286,9 +8286,7 @@ function reasonForReportToBeInOptionList({
82868286
}
82878287

82888288
// Archived reports should always be shown when in default (most recent) mode. This is because you should still be able to access and search for the chats to find them.
8289-
// This will get removed as part of https://github.com/Expensify/App/issues/59961
8290-
// eslint-disable-next-line deprecation/deprecation
8291-
if (isInDefaultMode && isArchivedNonExpenseReport(report, !!getReportNameValuePairs(report?.reportID)?.private_isArchived)) {
8289+
if (isInDefaultMode && isArchivedNonExpenseReport(report, isReportArchived)) {
82928290
return CONST.REPORT_IN_LHN_REASONS.IS_ARCHIVED;
82938291
}
82948292

src/libs/SidebarUtils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ function shouldDisplayReportInLHN(
205205
isInFocusMode: boolean,
206206
betas: OnyxEntry<Beta[]>,
207207
transactionViolations: OnyxCollection<TransactionViolation[]>,
208-
reportNameValuePairs?: OnyxCollection<ReportNameValuePairs>,
208+
isReportArchived?: boolean,
209209
reportAttributes?: ReportAttributesDerivedValue['reports'],
210210
) {
211211
if (!report) {
@@ -236,7 +236,6 @@ function shouldDisplayReportInLHN(
236236

237237
// Check if report should override hidden status
238238
const isSystemChat = isSystemChatUtil(report);
239-
const isReportArchived = isArchivedReport(reportNameValuePairs);
240239
const shouldOverrideHidden =
241240
hasValidDraftComment(report.reportID) || hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || !!report.isPinned || reportAttributes?.[report?.reportID]?.requiresAttention;
242241

@@ -286,7 +285,7 @@ function getReportsToDisplayInLHN(
286285
isInFocusMode,
287286
betas,
288287
transactionViolations,
289-
reportNameValuePairs,
288+
isArchivedReport(reportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`]),
290289
reportAttributes,
291290
);
292291

@@ -324,7 +323,7 @@ function updateReportsToDisplayInLHN(
324323
isInFocusMode,
325324
betas,
326325
transactionViolations,
327-
reportNameValuePairs,
326+
isArchivedReport(reportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`]),
328327
reportAttributes,
329328
);
330329

0 commit comments

Comments
 (0)