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: 1 addition & 3 deletions src/libs/OptionsListUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,6 @@ function createOption(
isSelfDM: report ? reportUtilsIsSelfDM(report) : false,
isChatRoom: report ? reportUtilsIsChatRoom(report) : false,
isInvoiceRoom: report ? isInvoiceRoom(report) : false,
isDM: report ? isDM(report) : false,

// Status properties - used in SearchOption context
private_isArchived: undefined, // Set from reportNameValuePairs below
Expand Down Expand Up @@ -1845,7 +1844,6 @@ function isValidReport(option: SearchOption<Report>, config: IsValidReportsConfi
excludeNonAdminWorkspaces,
isRestrictedToPreferredPolicy,
preferredPolicyID,
shouldAlwaysIncludeDM,
} = config;
const topmostReportId = Navigation.getTopmostReportId();

Expand Down Expand Up @@ -1941,7 +1939,7 @@ function isValidReport(option: SearchOption<Report>, config: IsValidReportsConfi
- It doesn't have a login
- It is not an invoice room that should be shown
*/
if (!isCurrentUserOwnedPolicyExpenseChatThatCouldShow && !includeMultipleParticipantReports && !option.login && (!option.isDM || !shouldAlwaysIncludeDM) && !shouldShowInvoiceRoom) {
if (!isCurrentUserOwnedPolicyExpenseChatThatCouldShow && !includeMultipleParticipantReports && !option.login && !shouldShowInvoiceRoom) {
return false;
}

Expand Down
3 changes: 0 additions & 3 deletions src/libs/OptionsListUtils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ type SearchOptionData = Pick<
| 'isChatRoom'
| 'isInvoiceRoom'
| 'isDefaultRoom'
| 'isDM'

// Status properties
| 'private_isArchived'
Expand Down Expand Up @@ -156,7 +155,6 @@ type GetValidReportsConfig = {
isRestrictedToPreferredPolicy?: boolean;
preferredPolicyID?: string;
shouldUnreadBeBold?: boolean;
shouldAlwaysIncludeDM?: boolean;
} & GetValidOptionsSharedConfig;

type IsValidReportsConfig = Pick<
Expand All @@ -178,7 +176,6 @@ type IsValidReportsConfig = Pick<
| 'excludeNonAdminWorkspaces'
| 'isRestrictedToPreferredPolicy'
| 'preferredPolicyID'
| 'shouldAlwaysIncludeDM'
>;

type GetOptionsConfig = {
Expand Down
1 change: 0 additions & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,6 @@ type OptionData = {
isDefaultRoom?: boolean;
isInvoiceRoom?: boolean;
isExpenseReport?: boolean;
isDM?: boolean;
isOptimisticPersonalDetail?: boolean;
selected?: boolean;
isOptimisticAccount?: boolean;
Expand Down
11 changes: 1 addition & 10 deletions src/pages/NewChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ function useOptions() {
{
betas: betas ?? [],
includeSelfDM: true,
shouldAlwaysIncludeDM: true,
},
countryCode,
);
Expand Down Expand Up @@ -343,14 +342,6 @@ function NewChatPage({ref}: NewChatPageProps) {
Navigation.dismissModalWithReport({reportID: option.reportID});
return;
}
if (option?.reportID) {
Navigation.dismissModal({
callback: () => {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(option?.reportID));
},
});
return;
}
if (selectedOptions.length && option) {
// Prevent excluded emails from being added to groups
if (option?.login && excludedGroupEmails.has(option.login)) {
Expand Down Expand Up @@ -380,7 +371,7 @@ function NewChatPage({ref}: NewChatPageProps) {

const itemRightSideComponent = useCallback(
(item: ListItem & Option, isFocused?: boolean) => {
if (!!item.isSelfDM || (item.login && excludedGroupEmails.has(item.login)) || !item.login) {
if (!!item.isSelfDM || (item.login && excludedGroupEmails.has(item.login))) {
return null;
}

Expand Down