Skip to content

Commit bb3e090

Browse files
authored
Merge pull request Expensify#67381 from callstack-internal/onyx-bump-2.0.130
Bump react-native-onyx to 2.0.130
2 parents 69e5df7 + aaa856e commit bb3e090

4 files changed

Lines changed: 17 additions & 9 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.127",
182+
"react-native-onyx": "2.0.130",
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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import {deepEqual} from 'fast-equals';
22
import React, {createContext, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';
3-
import type {OnyxEntry} from 'react-native-onyx';
3+
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
44
import Log from '@libs/Log';
55
import {getPolicyEmployeeListByIdWithoutCurrentUser} from '@libs/PolicyUtils';
6+
import {reportAttributesSelector} from '@libs/ReportUtils';
67
import SidebarUtils from '@libs/SidebarUtils';
78
import CONST from '@src/CONST';
89
import ONYXKEYS from '@src/ONYXKEYS';
@@ -44,6 +45,8 @@ const policySelector = (policy: OnyxEntry<OnyxTypes.Policy>): PartialPolicyForSi
4445
employeeList: policy.employeeList,
4546
}) as PartialPolicyForSidebar;
4647

48+
const policiesSelector = (policies: OnyxCollection<OnyxTypes.Policy>) => mapOnyxCollectionItems(policies, policySelector);
49+
4750
function SidebarOrderedReportsContextProvider({
4851
children,
4952
/**
@@ -59,13 +62,13 @@ function SidebarOrderedReportsContextProvider({
5962
const {localeCompare} = useLocalize();
6063
const [priorityMode = CONST.PRIORITY_MODE.DEFAULT] = useOnyx(ONYXKEYS.NVP_PRIORITY_MODE, {canBeMissing: true});
6164
const [chatReports, {sourceValue: reportUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {canBeMissing: true});
62-
const [policies, {sourceValue: policiesUpdates}] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: (c) => mapOnyxCollectionItems(c, policySelector), canBeMissing: true});
65+
const [policies, {sourceValue: policiesUpdates}] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: policiesSelector, canBeMissing: true});
6366
const [transactions, {sourceValue: transactionsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: true});
6467
const [transactionViolations, {sourceValue: transactionViolationsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: true});
6568
const [reportNameValuePairs, {sourceValue: reportNameValuePairsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS, {canBeMissing: true});
6669
const [, {sourceValue: reportsDraftsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: true});
6770
const [betas] = useOnyx(ONYXKEYS.BETAS, {canBeMissing: true});
68-
const [reportAttributes] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {selector: (value) => value?.reports, canBeMissing: true});
71+
const [reportAttributes] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {selector: reportAttributesSelector, canBeMissing: true});
6972
const [currentReportsToDisplay, setCurrentReportsToDisplay] = useState<ReportsToDisplayInLHN>({});
7073

7174
const {shouldUseNarrowLayout} = useResponsiveLayout();

src/libs/ReportUtils.ts

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

11279+
function reportAttributesSelector(reportAttributes: OnyxEntry<ReportAttributesDerivedValue>) {
11280+
return reportAttributes?.reports;
11281+
}
11282+
1127911283
export {
1128011284
areAllRequestsBeingSmartScanned,
1128111285
buildOptimisticAddCommentReportAction,
@@ -11656,6 +11660,7 @@ export {
1165611660
isWorkspaceTaskReport,
1165711661
isWorkspaceThread,
1165811662
getReportStatusTranslation,
11663+
reportAttributesSelector,
1165911664
};
1166011665

1166111666
export type {

0 commit comments

Comments
 (0)