From b277f4933dbc543bd3bf376f9b2949debcaea0ab Mon Sep 17 00:00:00 2001 From: Vit Horacek <36083550+mountiny@users.noreply.github.com> Date: Tue, 5 Aug 2025 11:31:02 +0200 Subject: [PATCH] Revert "Bump react-native-onyx to 2.0.130" --- package-lock.json | 10 +++++----- package.json | 2 +- src/hooks/useSidebarOrderedReports.tsx | 9 +++------ src/libs/ReportUtils.ts | 5 ----- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8b4e46e8e406..2f18d3218b43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -109,7 +109,7 @@ "react-native-modal": "^13.0.0", "react-native-nitro-modules": "0.26.2", "react-native-nitro-sqlite": "9.1.10", - "react-native-onyx": "2.0.130", + "react-native-onyx": "2.0.127", "react-native-pager-view": "6.5.3", "react-native-pdf": "6.7.3", "react-native-performance": "^5.1.4", @@ -34002,9 +34002,9 @@ } }, "node_modules/react-native-onyx": { - "version": "2.0.130", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-2.0.130.tgz", - "integrity": "sha512-GlrWbRBTHasQBTZcKWJ2/nZ20YACLPTGHAlBGL9CNh3cV/1Jr7r/1uIyaiYD/cLyi70PnsXPH307eXxNwf8BWA==", + "version": "2.0.127", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-2.0.127.tgz", + "integrity": "sha512-D5EeJspj6jjL10DclBbdIGVyqInSzwyzTZDejt6+SJxThk3zTbEClddkp6gXD7T9vilhIEi7+xXYkUvD/SO75w==", "license": "MIT", "dependencies": { "ascii-table": "0.0.9", @@ -34016,7 +34016,7 @@ "underscore": "^1.13.6" }, "engines": { - "node": ">=20.19.3", + "node": ">=20.19.1", "npm": ">=10.8.2" }, "peerDependencies": { diff --git a/package.json b/package.json index 5f19f5152f79..c22980dea017 100644 --- a/package.json +++ b/package.json @@ -179,7 +179,7 @@ "react-native-modal": "^13.0.0", "react-native-nitro-modules": "0.26.2", "react-native-nitro-sqlite": "9.1.10", - "react-native-onyx": "2.0.130", + "react-native-onyx": "2.0.127", "react-native-pager-view": "6.5.3", "react-native-pdf": "6.7.3", "react-native-performance": "^5.1.4", diff --git a/src/hooks/useSidebarOrderedReports.tsx b/src/hooks/useSidebarOrderedReports.tsx index e26b0d3a78b0..d3a43c179f16 100644 --- a/src/hooks/useSidebarOrderedReports.tsx +++ b/src/hooks/useSidebarOrderedReports.tsx @@ -1,9 +1,8 @@ import {deepEqual} from 'fast-equals'; import React, {createContext, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react'; -import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; import Log from '@libs/Log'; import {getPolicyEmployeeListByIdWithoutCurrentUser} from '@libs/PolicyUtils'; -import {reportAttributesSelector} from '@libs/ReportUtils'; import SidebarUtils from '@libs/SidebarUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -45,8 +44,6 @@ const policySelector = (policy: OnyxEntry): PartialPolicyForSi employeeList: policy.employeeList, }) as PartialPolicyForSidebar; -const policiesSelector = (policies: OnyxCollection) => mapOnyxCollectionItems(policies, policySelector); - function SidebarOrderedReportsContextProvider({ children, /** @@ -62,13 +59,13 @@ function SidebarOrderedReportsContextProvider({ const {localeCompare} = useLocalize(); const [priorityMode = CONST.PRIORITY_MODE.DEFAULT] = useOnyx(ONYXKEYS.NVP_PRIORITY_MODE, {canBeMissing: true}); const [chatReports, {sourceValue: reportUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {canBeMissing: true}); - const [policies, {sourceValue: policiesUpdates}] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: policiesSelector, canBeMissing: true}); + const [policies, {sourceValue: policiesUpdates}] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: (c) => mapOnyxCollectionItems(c, policySelector), canBeMissing: true}); const [transactions, {sourceValue: transactionsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: true}); const [transactionViolations, {sourceValue: transactionViolationsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: true}); const [reportNameValuePairs, {sourceValue: reportNameValuePairsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS, {canBeMissing: true}); const [, {sourceValue: reportsDraftsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: true}); const [betas] = useOnyx(ONYXKEYS.BETAS, {canBeMissing: true}); - const [reportAttributes] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {selector: reportAttributesSelector, canBeMissing: true}); + const [reportAttributes] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {selector: (value) => value?.reports, canBeMissing: true}); const [currentReportsToDisplay, setCurrentReportsToDisplay] = useState({}); const {shouldUseNarrowLayout} = useResponsiveLayout(); diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 49ffb6c0b48c..8267312e54e5 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -11276,10 +11276,6 @@ function getReportStatusTranslation(stateNum?: number, statusNum?: number): stri return ''; } -function reportAttributesSelector(reportAttributes: OnyxEntry) { - return reportAttributes?.reports; -} - export { areAllRequestsBeingSmartScanned, buildOptimisticAddCommentReportAction, @@ -11660,7 +11656,6 @@ export { isWorkspaceTaskReport, isWorkspaceThread, getReportStatusTranslation, - reportAttributesSelector, }; export type {