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
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
"react-native-localize": "^3.5.4",
"react-native-nitro-modules": "0.35.0",
"react-native-nitro-sqlite": "9.6.0",
"react-native-onyx": "3.0.89",
"react-native-onyx": "3.0.88",
"react-native-pager-view": "8.0.0",
"react-native-pdf": "7.0.2",
"react-native-permissions": "^5.4.0",
Expand Down
1 change: 1 addition & 0 deletions src/libs/DistanceRequestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ let allPolicies: OnyxCollection<Policy>;

Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => (allPolicies = value),
});

Expand Down
1 change: 1 addition & 0 deletions src/libs/Fullstory/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type {GetChatFSClass, ShouldInitialize} from './types';
let allReports: OnyxCollection<Report>;
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
allReports = value;
},
Expand Down
2 changes: 2 additions & 0 deletions src/libs/Middleware/Pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ function registerPaginationConfig<TResourceKey extends OnyxCollectionKey, TPageK
} as unknown as PaginationConfigMapValue);
Onyx.connectWithoutView<OnyxCollectionKey>({
key: config.resourceCollectionKey,
waitForCollectionCallback: true,
callback: (data) => {
resources.set(config.resourceCollectionKey, data);
},
});
Onyx.connectWithoutView<OnyxPagesKey>({
key: config.pageCollectionKey,
waitForCollectionCallback: true,
callback: (data) => {
pages.set(config.pageCollectionKey, data);
},
Expand Down
2 changes: 2 additions & 0 deletions src/libs/Notification/LocalNotification/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let allPolicies: OnyxCollection<Policy>;
// see https://github.com/Expensify/App/issues/66336
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => {
allPolicies = value;
},
Expand All @@ -24,6 +25,7 @@ let allPolicyTags: OnyxCollection<PolicyTagLists>;
// see https://github.com/Expensify/App/issues/66336
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.POLICY_TAGS,
waitForCollectionCallback: true,
callback: (value) => {
allPolicyTags = value;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ Onyx.connectWithoutView({
let allReportActions: OnyxCollection<ReportActions>;
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (value) => (allReportActions = value),
});

let allReports: OnyxCollection<ReportType>;
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => (allReports = value),
});

Expand Down
2 changes: 2 additions & 0 deletions src/libs/OptionsListUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ import {doesPersonalDetailMatchSearchTerm, getCurrentUserSearchTerms, getPersona
let allReports: OnyxCollection<Report>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
allReports = value;
},
Expand All @@ -248,6 +249,7 @@ const deprecatedCachedOneTransactionThreadReportIDs: Record<string, string | und
let deprecatedAllReportActions: OnyxCollection<ReportActions>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
if (!actions) {
return;
Expand Down
1 change: 1 addition & 0 deletions src/libs/Parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const accountIDToNameMap: Record<string, string> = {};
let reportIDToNameMap: Record<string, string> = {};
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
// Clear the map so removed reports don’t linger
reportIDToNameMap = {};
Expand Down
3 changes: 3 additions & 0 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ function isHarvestCreatedExpenseReport(origin?: string, originalID?: string): bo
let allReportActions: OnyxCollection<ReportActions>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
if (!actions) {
return;
Expand All @@ -115,6 +116,7 @@ Onyx.connect({
let allReports: OnyxCollection<Report>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
allReports = value;
},
Expand All @@ -141,6 +143,7 @@ Onyx.connect({
let allReportNameValuePair: OnyxCollection<ReportNameValuePairs>;
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS,
waitForCollectionCallback: true,
callback: (value) => {
if (!value) {
return;
Expand Down
1 change: 1 addition & 0 deletions src/libs/ReportTitleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let allReportNameValuePairs: Record<string, ReportNameValuePairs> = {};
*/
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS,
waitForCollectionCallback: true,
callback: (val) => {
allReportNameValuePairs = (val as Record<string, ReportNameValuePairs>) ?? {};
},
Expand Down
8 changes: 8 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1058,13 +1058,15 @@ Onyx.connect({
let deprecatedAllReportsDraft: OnyxCollection<Report>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT_DRAFT,
waitForCollectionCallback: true,
callback: (value) => (deprecatedAllReportsDraft = value),
});

let allPolicies: OnyxCollection<Policy>;
let policiesArray: Policy[] = [];
Onyx.connect({
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => {
allPolicies = value;
policiesArray = Object.values(value ?? {}).filter((policy): policy is Policy => !!policy);
Expand All @@ -1074,13 +1076,15 @@ Onyx.connect({
let allPolicyDrafts: OnyxCollection<Policy>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.POLICY_DRAFTS,
waitForCollectionCallback: true,
callback: (value) => (allPolicyDrafts = value),
});

let deprecatedAllReports: OnyxCollection<Report>;
let deprecatedReportsByPolicyID: ReportByPolicyMap;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
deprecatedAllReports = value;

Expand Down Expand Up @@ -1112,6 +1116,7 @@ let deprecatedAllTransactions: OnyxCollection<Transaction> = {};
let deprecatedReportsTransactions: Record<string, Transaction[]> = {};
Onyx.connect({
key: ONYXKEYS.COLLECTION.TRANSACTION,
waitForCollectionCallback: true,
callback: (value) => {
if (!value) {
return;
Expand All @@ -1137,6 +1142,7 @@ Onyx.connect({
let allReportActions: OnyxCollection<ReportActions>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
if (!actions) {
return;
Expand All @@ -1149,6 +1155,7 @@ let allReportMetadata: OnyxCollection<ReportMetadata>;
const allReportMetadataKeyValue: Record<string, ReportMetadata> = {};
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT_METADATA,
waitForCollectionCallback: true,
callback: (value) => {
if (!value) {
return;
Expand Down Expand Up @@ -1178,6 +1185,7 @@ Onyx.connectWithoutView({
let allReportNameValuePair: OnyxCollection<ReportNameValuePairs>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS,
waitForCollectionCallback: true,
callback: (value) => {
if (!value) {
return;
Expand Down
4 changes: 4 additions & 0 deletions src/libs/UnreadIndicatorUpdater/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ let allReportNameValuePairs: OnyxCollection<ReportNameValuePairs> = {};
// This subscription is used to update the unread indicators count which is not linked to UI and it does not update any UI state.
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS,
waitForCollectionCallback: true,
callback: (value) => {
allReportNameValuePairs = value;
},
Expand All @@ -52,6 +53,7 @@ let allReportActions: OnyxCollection<ReportActions> = {};
// This subscription is used to update the unread indicators count which is not linked to UI and it does not update any UI state.
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (value) => {
allReportActions = value;
},
Expand All @@ -60,6 +62,7 @@ Onyx.connectWithoutView({
let allDraftComments: OnyxCollection<string> = {};
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT,
waitForCollectionCallback: true,
callback: (value) => {
allDraftComments = value;
},
Expand Down Expand Up @@ -132,6 +135,7 @@ const triggerUnreadUpdate = debounce(() => {
// This subscription is used to update the unread indicators count which is not linked to UI and it does not update any UI state.
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
allReports = value;
triggerUnreadUpdate();
Expand Down
2 changes: 2 additions & 0 deletions src/libs/actions/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ let allReports: OnyxCollection<OnyxTypes.Report>;
let allPolicies: OnyxCollection<OnyxTypes.Policy>;
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
allReports = value;
},
});
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => {
allPolicies = value;
},
Expand Down
2 changes: 2 additions & 0 deletions src/libs/actions/ClearReportActionErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ type IgnoreDirection = 'parent' | 'child';
let allReportActions: OnyxCollection<OnyxTypes.ReportActions>;
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (value) => (allReportActions = value),
});

let allReports: OnyxCollection<OnyxTypes.Report>;
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
allReports = value;
},
Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/Export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function clearStaleExportDownloads() {
// to the entire collection, which would cause unnecessary re-renders on every change.
const connectionID = Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.EXPORT_DOWNLOAD,
waitForCollectionCallback: true,
callback: (exportDownloads) => {
Onyx.disconnect(connectionID);
if (!exportDownloads) {
Expand Down
7 changes: 7 additions & 0 deletions src/libs/actions/IOU/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Onyx.connect({
let allTransactions: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({
key: ONYXKEYS.COLLECTION.TRANSACTION,
waitForCollectionCallback: true,
callback: (value) => {
if (!value) {
allTransactions = {};
Expand All @@ -31,6 +32,7 @@ Onyx.connect({
let allTransactionDrafts: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({
key: ONYXKEYS.COLLECTION.TRANSACTION_DRAFT,
waitForCollectionCallback: true,
callback: (value) => {
allTransactionDrafts = value ?? {};
},
Expand All @@ -40,6 +42,7 @@ Onyx.connect({
let allTransactionViolations: NonNullable<OnyxCollection<OnyxTypes.TransactionViolations>> = {};
Onyx.connect({
key: ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS,
waitForCollectionCallback: true,
callback: (value) => {
if (!value) {
allTransactionViolations = {};
Expand All @@ -53,6 +56,7 @@ Onyx.connect({
let allPolicyTags: OnyxCollection<OnyxTypes.PolicyTagLists> = {};
Onyx.connect({
key: ONYXKEYS.COLLECTION.POLICY_TAGS,
waitForCollectionCallback: true,
callback: (value) => {
if (!value) {
allPolicyTags = {};
Expand All @@ -65,6 +69,7 @@ Onyx.connect({
let allReports: OnyxCollection<OnyxTypes.Report>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
allReports = value;
},
Expand All @@ -73,6 +78,7 @@ Onyx.connect({
let allReportNameValuePairs: OnyxCollection<OnyxTypes.ReportNameValuePairs>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS,
waitForCollectionCallback: true,
callback: (value) => {
allReportNameValuePairs = value;
},
Expand All @@ -97,6 +103,7 @@ Onyx.connect({
let allReportActions: OnyxCollection<OnyxTypes.ReportActions>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
if (!actions) {
return;
Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/OnyxDerived/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ function init() {
if (OnyxKeys.isCollectionKey(dependencyOnyxKey)) {
Onyx.connectWithoutView({
key: dependencyOnyxKey,
waitForCollectionCallback: true,
callback: (value, collectionKey) => {
Log.info(`[OnyxDerived] dependency ${collectionKey} for derived key ${key} changed, recomputing`);
setDependencyValue(dependencyIndex, value as Parameters<typeof compute>[0][typeof dependencyIndex]);
Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/Policy/Member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function hasPolicyAdminsRoomsAccess(role: string | undefined): boolean {
let allReportActions: OnyxCollection<ReportActions>;
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => (allReportActions = actions),
});

Expand Down
2 changes: 2 additions & 0 deletions src/libs/actions/Report/DeleteReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ import Onyx from 'react-native-onyx';
let allReports: OnyxCollection<Report>;
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => (allReports = value),
});

let allReportActions: OnyxCollection<ReportActions>;
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (value) => (allReportActions = value),
});

Expand Down
2 changes: 2 additions & 0 deletions src/libs/actions/Report/MarkAllMessageAsRead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ import Onyx from 'react-native-onyx';
let allReportActions: OnyxCollection<ReportActions>;
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (value) => (allReportActions = value),
});

let allReports: OnyxCollection<Report>;
Onyx.connectWithoutView({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => (allReports = value),
});

Expand Down
Loading
Loading