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 @@ -190,7 +190,7 @@
*/
let currentUserLogin: string | undefined;
let currentUserAccountID: number | undefined;
Onyx.connect({

Check warning on line 193 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
currentUserLogin = value?.email;
Expand All @@ -199,13 +199,13 @@
});

let allPersonalDetails: OnyxEntry<PersonalDetailsList>;
Onyx.connect({

Check warning on line 202 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => (allPersonalDetails = isEmptyObject(value) ? {} : value),
});

const policies: OnyxCollection<Policy> = {};
Onyx.connect({

Check warning on line 208 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
callback: (policy, key) => {
if (!policy || !key || !policy.name) {
Expand All @@ -217,14 +217,14 @@
});

let allPolicies: OnyxCollection<Policy> = {};
Onyx.connect({

Check warning on line 220 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (val) => (allPolicies = val),
});

let allReports: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 227 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -233,7 +233,7 @@
});

let allReportNameValuePairs: OnyxCollection<ReportNameValuePairs>;
Onyx.connect({

Check warning on line 236 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -245,7 +245,7 @@
const allSortedReportActions: Record<string, ReportAction[]> = {};
let allReportActions: OnyxCollection<ReportActions>;
const lastVisibleReportActions: ReportActions = {};
Onyx.connect({

Check warning on line 248 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand Down Expand Up @@ -307,7 +307,7 @@
});

let activePolicyID: OnyxEntry<string>;
Onyx.connect({

Check warning on line 310 in src/libs/OptionsListUtils/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_ACTIVE_POLICY_ID,
callback: (value) => (activePolicyID = value),
});
Expand Down Expand Up @@ -892,7 +892,6 @@
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 @@
excludeNonAdminWorkspaces,
isRestrictedToPreferredPolicy,
preferredPolicyID,
shouldAlwaysIncludeDM,
} = config;
const topmostReportId = Navigation.getTopmostReportId();

Expand Down Expand Up @@ -1941,7 +1939,7 @@
- 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 @@ -23,7 +23,7 @@
import type {MoneyRequestAmountInputProps} from '@components/MoneyRequestAmountInput';
import type {TransactionWithOptionalSearchFields} from '@components/TransactionItemRow';
import type PolicyData from '@hooks/usePolicyData/types';
import {computeReportName} from '@libs/ReportNameUtils';

Check warning on line 26 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Unexpected subpath import via alias '@libs/ReportNameUtils'. Use './ReportNameUtils' instead
import type {PolicyTagList} from '@pages/workspace/tags/types';
import type {ThemeColors} from '@styles/theme/types';
import type {IOUAction, IOUType, OnboardingAccounting} from '@src/CONST';
Expand Down Expand Up @@ -857,7 +857,6 @@
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
Loading