Skip to content

Commit 557e520

Browse files
authored
Merge pull request Expensify#67878 from Expensify/revert-67381-onyx-bump-2.0.130
[CP Staging] Revert "Bump react-native-onyx to 2.0.130"
2 parents 3c1d3c5 + b277f49 commit 557e520

4 files changed

Lines changed: 9 additions & 17 deletions

File tree

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
"react-native-modal": "^13.0.0",
180180
"react-native-nitro-modules": "0.26.2",
181181
"react-native-nitro-sqlite": "9.1.10",
182-
"react-native-onyx": "2.0.130",
182+
"react-native-onyx": "2.0.127",
183183
"react-native-pager-view": "6.5.3",
184184
"react-native-pdf": "6.7.3",
185185
"react-native-performance": "^5.1.4",

src/hooks/useSidebarOrderedReports.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import {deepEqual} from 'fast-equals';
22
import React, {createContext, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';
3-
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
3+
import type {OnyxEntry} from 'react-native-onyx';
44
import Log from '@libs/Log';
55
import {getPolicyEmployeeListByIdWithoutCurrentUser} from '@libs/PolicyUtils';
6-
import {reportAttributesSelector} from '@libs/ReportUtils';
76
import SidebarUtils from '@libs/SidebarUtils';
87
import CONST from '@src/CONST';
98
import ONYXKEYS from '@src/ONYXKEYS';
@@ -45,8 +44,6 @@ const policySelector = (policy: OnyxEntry<OnyxTypes.Policy>): PartialPolicyForSi
4544
employeeList: policy.employeeList,
4645
}) as PartialPolicyForSidebar;
4746

48-
const policiesSelector = (policies: OnyxCollection<OnyxTypes.Policy>) => mapOnyxCollectionItems(policies, policySelector);
49-
5047
function SidebarOrderedReportsContextProvider({
5148
children,
5249
/**
@@ -62,13 +59,13 @@ function SidebarOrderedReportsContextProvider({
6259
const {localeCompare} = useLocalize();
6360
const [priorityMode = CONST.PRIORITY_MODE.DEFAULT] = useOnyx(ONYXKEYS.NVP_PRIORITY_MODE, {canBeMissing: true});
6461
const [chatReports, {sourceValue: reportUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {canBeMissing: true});
65-
const [policies, {sourceValue: policiesUpdates}] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: policiesSelector, canBeMissing: true});
62+
const [policies, {sourceValue: policiesUpdates}] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: (c) => mapOnyxCollectionItems(c, policySelector), canBeMissing: true});
6663
const [transactions, {sourceValue: transactionsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: true});
6764
const [transactionViolations, {sourceValue: transactionViolationsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: true});
6865
const [reportNameValuePairs, {sourceValue: reportNameValuePairsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS, {canBeMissing: true});
6966
const [, {sourceValue: reportsDraftsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: true});
7067
const [betas] = useOnyx(ONYXKEYS.BETAS, {canBeMissing: true});
71-
const [reportAttributes] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {selector: reportAttributesSelector, canBeMissing: true});
68+
const [reportAttributes] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {selector: (value) => value?.reports, canBeMissing: true});
7269
const [currentReportsToDisplay, setCurrentReportsToDisplay] = useState<ReportsToDisplayInLHN>({});
7370

7471
const {shouldUseNarrowLayout} = useResponsiveLayout();

src/libs/ReportUtils.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11276,10 +11276,6 @@ function getReportStatusTranslation(stateNum?: number, statusNum?: number): stri
1127611276
return '';
1127711277
}
1127811278

11279-
function reportAttributesSelector(reportAttributes: OnyxEntry<ReportAttributesDerivedValue>) {
11280-
return reportAttributes?.reports;
11281-
}
11282-
1128311279
export {
1128411280
areAllRequestsBeingSmartScanned,
1128511281
buildOptimisticAddCommentReportAction,
@@ -11660,7 +11656,6 @@ export {
1166011656
isWorkspaceTaskReport,
1166111657
isWorkspaceThread,
1166211658
getReportStatusTranslation,
11663-
reportAttributesSelector,
1166411659
};
1166511660

1166611661
export type {

0 commit comments

Comments
 (0)