Skip to content

Commit

Permalink
fix move check to report uitls
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed Jul 2, 2024
1 parent a3f5a30 commit b9a6938
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1866,6 +1866,8 @@ function getOptions(
isInFocusMode: false,
excludeEmptyChats: false,
includeSelfDM,
login: option.login,
includeDomainEmail,
});
});

Expand Down Expand Up @@ -1915,10 +1917,6 @@ function getOptions(
return;
}

if (Str.isDomainEmail(option.login ?? '') && !includeDomainEmail) {
return;
}

if (isThread && !includeThreads) {
return;
}
Expand Down Expand Up @@ -2194,7 +2192,6 @@ function getFilteredOptions(
policyReportFieldOptions: string[] = [],
recentlyUsedPolicyReportFieldOptions: string[] = [],
includeInvoiceRooms = false,
includeDomainEmail = false,
) {
return getOptions(
{reports, personalDetails},
Expand Down Expand Up @@ -2222,7 +2219,6 @@ function getFilteredOptions(
policyReportFieldOptions,
recentlyUsedPolicyReportFieldOptions,
includeInvoiceRooms,
includeDomainEmail,
},
);
}
Expand Down
9 changes: 9 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5383,6 +5383,8 @@ function shouldReportBeInOptionList({
excludeEmptyChats,
doesReportHaveViolations,
includeSelfDM = false,
login,
includeDomainEmail = false,
}: {
report: OnyxEntry<Report>;
currentReportId: string;
Expand All @@ -5392,6 +5394,8 @@ function shouldReportBeInOptionList({
excludeEmptyChats: boolean;
doesReportHaveViolations: boolean;
includeSelfDM?: boolean;
login?: string;
includeDomainEmail?: boolean;
}) {
const isInDefaultMode = !isInFocusMode;
// Exclude reports that have no data because there wouldn't be anything to show in the option item.
Expand Down Expand Up @@ -5495,6 +5499,11 @@ function shouldReportBeInOptionList({
if (isSelfDM(report)) {
return includeSelfDM;
}

if (Str.isDomainEmail(login ?? '') && !includeDomainEmail) {
return false;
}

const parentReportAction = ReportActionsUtils.getParentReportAction(report);

// Hide chat threads where the parent message is pending removal
Expand Down

0 comments on commit b9a6938

Please sign in to comment.