Skip to content

Commit d19a574

Browse files
authored
Merge pull request #44061 from dominictb/fix/43599
fix: Unpinned and read 'Expensify' chat persists in LHN in '#focus'
2 parents 936b051 + 6fc46c5 commit d19a574

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

src/libs/ReportUtils.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -5387,8 +5387,6 @@ function shouldReportBeInOptionList({
53875387
report?.reportName === undefined ||
53885388
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
53895389
report?.isHidden ||
5390-
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
5391-
participantAccountIDs.includes(CONST.ACCOUNT_ID.NOTIFICATIONS) ||
53925390
(participantAccountIDs.length === 0 &&
53935391
!isChatThread(report) &&
53945392
!isPublicRoom(report) &&
@@ -5404,6 +5402,10 @@ function shouldReportBeInOptionList({
54045402
return false;
54055403
}
54065404

5405+
if (participantAccountIDs.includes(CONST.ACCOUNT_ID.NOTIFICATIONS) && (!currentUserAccountID || !AccountUtils.isAccountIDOddNumber(currentUserAccountID))) {
5406+
return false;
5407+
}
5408+
54075409
if (!canAccessReport(report, policies, betas)) {
54085410
return false;
54095411
}

src/libs/SidebarUtils.ts

-16
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import type PriorityMode from '@src/types/onyx/PriorityMode';
1111
import type Report from '@src/types/onyx/Report';
1212
import type ReportAction from '@src/types/onyx/ReportAction';
1313
import type DeepValueOf from '@src/types/utils/DeepValueOf';
14-
import AccountUtils from './AccountUtils';
1514
import * as CollectionUtils from './CollectionUtils';
1615
import {hasValidDraftComment} from './DraftCommentUtils';
1716
import localeCompare from './LocaleCompare';
@@ -43,14 +42,6 @@ Onyx.connect({
4342
},
4443
});
4544

46-
let currentUserAccountID: number | undefined;
47-
Onyx.connect({
48-
key: ONYXKEYS.SESSION,
49-
callback: (value) => {
50-
currentUserAccountID = value?.accountID;
51-
},
52-
});
53-
5445
function compareStringDates(a: string, b: string): 0 | 1 | -1 {
5546
if (a < b) {
5647
return -1;
@@ -115,13 +106,6 @@ function getOrderedReportIDs(
115106
return false;
116107
}
117108

118-
const participantAccountIDs = Object.keys(report?.participants ?? {}).map(Number);
119-
const isOnboardedByPersona = currentUserAccountID && AccountUtils.isAccountIDOddNumber(currentUserAccountID) && participantAccountIDs.includes(CONST.ACCOUNT_ID.NOTIFICATIONS);
120-
121-
if (isOnboardedByPersona && isSystemChat && !isInFocusMode) {
122-
return true;
123-
}
124-
125109
return ReportUtils.shouldReportBeInOptionList({
126110
report,
127111
currentReportId: currentReportId ?? '-1',

0 commit comments

Comments
 (0)