Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
27c4e07
Bump Onyx to 3.0.75
fabioh8010 May 19, 2026
cd5720f
Remove Onyx patch
fabioh8010 May 19, 2026
8fb2246
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 May 21, 2026
2b8620f
Merge commit '321ab1822add112c84f386094bc4f1dd7ef21559' into feature/…
fabioh8010 Jun 3, 2026
16d2a26
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jun 11, 2026
9ad61c3
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jun 12, 2026
eba8edc
Use newest Onyx changes from Onyx store-based PR 3
fabioh8010 Jun 12, 2026
1f28d58
Merge commit '7224b837ffd63958ddceebe1cbc50030fd3a7de1' into feature/…
fabioh8010 Jun 15, 2026
e504b9a
Merge branch 'feature/onyx-store-poc-baseline' into feature/onyx-stor…
fabioh8010 Jun 15, 2026
dc21da3
Memoize useOnyx selectors and drop the removed dependencies argument
fabioh8010 Jun 15, 2026
e0cd50f
Stabilize participant-policy useOnyx selectors for the store-based en…
fabioh8010 Jun 17, 2026
ba9fe32
Stabilize remaining useOnyx selectors with unstable non-primitive deps
fabioh8010 Jun 17, 2026
52ec1ed
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jun 18, 2026
e03d7e5
Merge branch 'main' into feature/onyx-store-pr-3
fabioh8010 Jun 18, 2026
1636974
Make Onyx selectors React-Compiler-compliant via stable input references
fabioh8010 Jun 18, 2026
68e8368
Rely on React Compiler for useOnyx selector memoization
fabioh8010 Jun 22, 2026
047f1a6
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jun 22, 2026
4b917a5
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jun 22, 2026
da65c23
Merge branch 'feature/onyx-store-poc-baseline' into feature/onyx-stor…
fabioh8010 Jun 22, 2026
2cc8061
Drop useStableArrayReference from PR 3 selector sites
fabioh8010 Jun 23, 2026
97c35ba
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jun 24, 2026
fa1b539
Merge branch 'feature/onyx-store-poc-baseline' into feature/onyx-stor…
fabioh8010 Jun 24, 2026
9f0dd6e
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jun 26, 2026
90739ae
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jun 29, 2026
1dacc5b
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jun 29, 2026
02f4cab
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jun 29, 2026
7a0ecc8
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jun 30, 2026
38aab40
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jul 1, 2026
70be921
Merge branch 'feature/onyx-store-poc-baseline' into feature/onyx-stor…
fabioh8010 Jul 1, 2026
af50be7
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jul 2, 2026
a2b649e
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jul 3, 2026
4dc10b2
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jul 6, 2026
a84be57
Merge branch 'main' into feature/onyx-store-poc-baseline
fabioh8010 Jul 7, 2026
be5c6e8
Merge branch 'feature/onyx-store-poc-baseline' into feature/onyx-stor…
fabioh8010 Jul 7, 2026
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.88",
"react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#5739db80220ed6bd205ae6d5114657eed727307e",
"react-native-pager-view": "8.0.0",
"react-native-pdf": "7.0.2",
"react-native-permissions": "^5.4.0",
Expand Down
14 changes: 5 additions & 9 deletions src/components/ChronosTimerHeaderButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,12 @@ function ChronosTimerHeaderButton({report}: ChronosTimerHeaderButtonProps) {

const {accountID: currentUserAccountID, timezone: timezoneParam} = useCurrentUserPersonalDetails();
const reportActionsOnyxKey = `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}` as OnyxKey;
const [timerStartTime] = useOnyx<OnyxKey, string | null>(
reportActionsOnyxKey,
{
selector: (reportActions: unknown): string | null => {
const sorted = getSortedReportActionsForDisplay(reportActions as OnyxEntry<ReportActions>, canPerformWriteAction, false, visibleReportActionsData, report.reportID);
return getTimeOfChronosTimerRunningFromVisibleActions(sorted, currentUserAccountID);
},
const [timerStartTime] = useOnyx<OnyxKey, string | null>(reportActionsOnyxKey, {
selector: (reportActions: unknown): string | null => {
const sorted = getSortedReportActionsForDisplay(reportActions as OnyxEntry<ReportActions>, canPerformWriteAction, false, visibleReportActionsData, report.reportID);
return getTimeOfChronosTimerRunningFromVisibleActions(sorted, currentUserAccountID);
},
[canPerformWriteAction, visibleReportActionsData, report.reportID, currentUserAccountID],
);
});

const [isLoadingInitialReportActions] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_REPORT_LOADING_STATE}${report.reportID}`, {
selector: isLoadingInitialReportActionsSelector,
Expand Down
13 changes: 10 additions & 3 deletions src/components/KYCWall/BaseKYCWall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ import ROUTES from '@src/ROUTES';
import type {Route} from '@src/ROUTES';
import {doesPersonalDetailExistSelector, personalDetailsLoginSelector} from '@src/selectors/PersonalDetails';
import {lastWorkspaceNumberSelector} from '@src/selectors/Policy';
import type {BankAccountList, Policy} from '@src/types/onyx';
import type {BankAccountList, PersonalDetailsList, Policy} from '@src/types/onyx';
import {getEmptyObject} from '@src/types/utils/EmptyObject';
import viewRef from '@src/types/utils/viewRef';

import type {EmitterSubscription, View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';

import {hasSeenTourSelector} from '@selectors/Onboarding';
import React, {useCallback, useEffect, useImperativeHandle, useRef, useState} from 'react';
Expand Down Expand Up @@ -75,8 +76,14 @@ function KYCWall({
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector});
const [betas] = useOnyx(ONYXKEYS.BETAS);
const [employeeLogin] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailsLoginSelector(iouReport?.ownerAccountID)}, [iouReport?.ownerAccountID]);
const [doesSubmitterPersonalDetailExist] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: doesPersonalDetailExistSelector(iouReport?.ownerAccountID)}, [iouReport?.ownerAccountID]);
const ownerAccountID = iouReport?.ownerAccountID;
const employeeLoginSelector = useCallback((personalDetailsList: OnyxEntry<PersonalDetailsList>) => personalDetailsLoginSelector(ownerAccountID)(personalDetailsList), [ownerAccountID]);
const [employeeLogin] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: employeeLoginSelector});
const doesSubmitterPersonalDetailExistSelector = useCallback(
(personalDetailsList: OnyxEntry<PersonalDetailsList>) => doesPersonalDetailExistSelector(ownerAccountID)(personalDetailsList),
[ownerAccountID],
);
const [doesSubmitterPersonalDetailExist] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: doesSubmitterPersonalDetailExistSelector});

const {formatPhoneNumber, translate} = useLocalize();
const currentUserDetails = useCurrentUserPersonalDetails();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ import ONYXKEYS from '@src/ONYXKEYS';
import type {Route} from '@src/ROUTES';
import {DYNAMIC_ROUTES} from '@src/ROUTES';
import {personalDetailsLoginSelector} from '@src/selectors/PersonalDetails';
import type {PersonalDetailsList} from '@src/types/onyx';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';

import type {OnyxEntry} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';

import {delegateEmailSelector, isUserValidatedSelector} from '@selectors/Account';
Expand Down Expand Up @@ -102,13 +104,10 @@ function MoneyReportHeaderSecondaryActionsInner({reportID, primaryAction, isRepo
const [moneyRequestReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getNonEmptyStringOnyxID(moneyRequestReport?.policyID)}`);
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(moneyRequestReport?.chatReportID)}`);
const [submitterLogin] = useOnyx(
ONYXKEYS.PERSONAL_DETAILS_LIST,
{
selector: personalDetailsLoginSelector(moneyRequestReport?.ownerAccountID),
},
[moneyRequestReport?.ownerAccountID],
);
const ownerAccountID = moneyRequestReport?.ownerAccountID;
const [submitterLogin] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {
selector: (personalDetailsList: OnyxEntry<PersonalDetailsList>) => personalDetailsLoginSelector(ownerAccountID)(personalDetailsList),
});
const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST);
const [nextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${moneyRequestReport?.reportID}`);
const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${moneyRequestReport?.reportID}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {Route} from '@src/ROUTES';
import {personalDetailsLoginSelector} from '@src/selectors/PersonalDetails';
import type {PersonalDetailsList} from '@src/types/onyx';

import type {StyleProp, ViewStyle} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';

import {useRoute} from '@react-navigation/native';
Expand Down Expand Up @@ -72,7 +74,10 @@ function MoneyReportHeaderSelectionDropdown({reportID, primaryAction, isReportIn
const [moneyRequestReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(reportID)}`);
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(moneyRequestReport?.chatReportID)}`);
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getNonEmptyStringOnyxID(moneyRequestReport?.policyID)}`);
const [submitterLogin] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailsLoginSelector(moneyRequestReport?.ownerAccountID)}, [moneyRequestReport?.ownerAccountID]);
const ownerAccountID = moneyRequestReport?.ownerAccountID;
const [submitterLogin] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {
selector: (personalDetailsList: OnyxEntry<PersonalDetailsList>) => personalDetailsLoginSelector(ownerAccountID)(personalDetailsList),
});
const [session] = useOnyx(ONYXKEYS.SESSION);
const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST);
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function SubmitPrimaryActionContent({reportID}: SubmitPrimaryActionProps) {

const [moneyRequestReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getNonEmptyStringOnyxID(moneyRequestReport?.policyID)}`);
const [submitterLogin] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailsLoginSelector(moneyRequestReport?.ownerAccountID)}, [moneyRequestReport?.ownerAccountID]);
const [submitterLogin] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailsLoginSelector(moneyRequestReport?.ownerAccountID)});
const [nextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${reportID}`);
const [userBillingGracePeriodEnds] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END);
const [amountOwed] = useOnyx(ONYXKEYS.NVP_PRIVATE_AMOUNT_OWED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ type InvoiceSenderFieldProps = {
const senderWorkspaceSelector = (policy: OnyxEntry<OnyxTypes.Policy>) => (policy ? {id: policy.id, name: policy.name, avatarURL: policy.avatarURL} : undefined);

const createCanUpdateSenderWorkspaceSelector =
(selectedParticipants: Participant[], currentUserLogin: string | undefined, isFromGlobalCreate: boolean) =>
(policies: OnyxCollection<OnyxTypes.Policy>): boolean => {
const isInvoiceRoomParticipant = selectedParticipants.some((participant) => participant.isInvoiceRoom);
return canSendInvoice(policies ?? null, currentUserLogin) && isFromGlobalCreate && !isInvoiceRoomParticipant;
};
(isInvoiceRoomParticipant: boolean, currentUserLogin: string | undefined, isFromGlobalCreate: boolean) =>
(policies: OnyxCollection<OnyxTypes.Policy>): boolean =>
canSendInvoice(policies ?? null, currentUserLogin) && isFromGlobalCreate && !isInvoiceRoomParticipant;

function InvoiceSenderField({selectedParticipants, isReadOnly, didConfirm, iouType, reportID, transaction}: InvoiceSenderFieldProps) {
const styles = useThemeStyles();
Expand All @@ -60,12 +58,15 @@ function InvoiceSenderField({selectedParticipants, isReadOnly, didConfirm, iouTy

const isFromGlobalCreate = !!transaction?.isFromGlobalCreate;

// The selector only needs whether any selected participant is an invoice room — project to that
// primitive so the memoized selector depends on a stable boolean rather than the `.filter()` result
// (a fresh array every render), which would otherwise change the selector identity each render and
// defeat useOnyx's memoization (re-subscribing endlessly under the store-based engine).
const isInvoiceRoomParticipant = selectedParticipants.some((participant) => participant.isInvoiceRoom);
// canSendInvoice needs the full policy collection to check all admin workspaces
const [canUpdateSenderWorkspace] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: createCanUpdateSenderWorkspaceSelector(selectedParticipants, currentUserLogin, isFromGlobalCreate)}, [
selectedParticipants,
currentUserLogin,
isFromGlobalCreate,
]);
const [canUpdateSenderWorkspace] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {
selector: (policies: OnyxCollection<OnyxTypes.Policy>) => createCanUpdateSenderWorkspaceSelector(isInvoiceRoomParticipant, currentUserLogin, isFromGlobalCreate)(policies),
});

return (
<MenuItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ function ReportField({selectedParticipants, iouType, reportID, reportActionID, a

const reportAttributes = useReportAttributes();
const policyID = selectedParticipants?.at(0)?.policyID;
const [outstandingReportsForPolicy] = useOnyx(ONYXKEYS.DERIVED.OUTSTANDING_REPORTS_BY_POLICY_ID, {selector: createOutstandingReportsForPolicySelector(policyID)}, [policyID]);
const [outstandingReportsForPolicy] = useOnyx(ONYXKEYS.DERIVED.OUTSTANDING_REPORTS_BY_POLICY_ID, {
selector: (derived: OnyxEntry<OnyxTypes.OutstandingReportsByPolicyIDDerivedValue>) => createOutstandingReportsForPolicySelector(policyID)(derived),
});
const [reportNameValuePairs] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS);

// Self-resolved narrow slice of the transaction; replaces the previously prop-drilled `transaction` object.
Expand Down
10 changes: 4 additions & 6 deletions src/components/Navigation/NavigationTabBar/InboxTabButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,11 @@ function WideInboxTabButton({selectedTab, statusIndicatorColor, accessibilityLab
return getStringParam(route?.params, 'reportActionID');
});

const [doesLastReportExist] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${lastReportRouteReportID}`, {selector: doesLastReportExistSelector}, [lastReportRouteReportID]);
const [doesLastReportExist] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${lastReportRouteReportID}`, {selector: doesLastReportExistSelector});

const doesLastReportActionExistSelector = makeDoesLastReportActionExistSelector(lastReportRouteReportActionID);
const [doesLastReportActionExist] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${lastReportRouteReportID}`, {selector: doesLastReportActionExistSelector}, [
lastReportRouteReportID,
lastReportRouteReportActionID,
]);
const [doesLastReportActionExist] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${lastReportRouteReportID}`, {
selector: (reportActions: OnyxEntry<ReportActions>) => makeDoesLastReportActionExistSelector(lastReportRouteReportActionID)(reportActions),
});

const navigateToChats = () => {
if (selectedTab === NAVIGATION_TABS.INBOX) {
Expand Down
5 changes: 3 additions & 2 deletions src/components/Navigation/QuickCreationActionsBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ function QuickCreationActionsBar() {
const {policyForMovingExpensesID, shouldSelectPolicy} = usePolicyForMovingExpenses();
const shouldNavigateToUpgradePath = !policyForMovingExpensesID && !shouldSelectPolicy;
const isSubmit2026BetaEnabled = isBetaEnabled(CONST.BETAS.SUBMIT_2026);
const groupPoliciesWithChatEnabledSelector = (policies: OnyxCollection<OnyxTypes.Policy>) => getGroupPoliciesWhereReportCanBeCreated(policies, isSubmit2026BetaEnabled, email);
const [groupPoliciesWithChatEnabled = CONST.EMPTY_ARRAY] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: groupPoliciesWithChatEnabledSelector}, [email, isSubmit2026BetaEnabled]);
const [groupPoliciesWithChatEnabled = CONST.EMPTY_ARRAY] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {
selector: (policies: OnyxCollection<OnyxTypes.Policy>) => getGroupPoliciesWhereReportCanBeCreated(policies, isSubmit2026BetaEnabled, email),
});

const defaultChatEnabledPolicy = useMemo(
() => getDefaultChatEnabledPolicy(groupPoliciesWithChatEnabled as Array<OnyxEntry<OnyxTypes.Policy>>, activePolicy),
Expand Down
10 changes: 3 additions & 7 deletions src/components/Reactions/ReactionTooltipContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,9 @@ function userNamesStringSelector(accountIDs: number[], currentUserAccountID: num
function ReactionTooltipContent({accountIDs, emojiCodes, emojiName, currentUserAccountID}: ReactionTooltipContentProps) {
const styles = useThemeStyles();
const {translate, preferredLocale} = useLocalize();
const [namesString] = useOnyx(
ONYXKEYS.PERSONAL_DETAILS_LIST,
{
selector: userNamesStringSelector(accountIDs, currentUserAccountID, translate),
},
[accountIDs, currentUserAccountID, translate],
);
const [namesString] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {
selector: (personalDetails: OnyxEntry<PersonalDetailsList>) => userNamesStringSelector(accountIDs, currentUserAccountID, translate)(personalDetails),
});
const localizedEmojiName = getLocalizedEmojiName(emojiName, preferredLocale);

return (
Expand Down
6 changes: 2 additions & 4 deletions src/components/ReportActionItem/MoneyRequestReceiptView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,8 @@ function MoneyRequestReceiptView({
const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector});
const [betas] = useOnyx(ONYXKEYS.BETAS);
const [conciergePersonalDetail] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: conciergePersonalDetailSelector});
const reportOwnerSelector = useMemo(() => personalDetailsSelector(report?.ownerAccountID), [report?.ownerAccountID]);
const [reportOwnerPersonalDetail] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: reportOwnerSelector}, [reportOwnerSelector]);
const chatReportOwnerSelector = useMemo(() => personalDetailsSelector(chatReport?.ownerAccountID), [chatReport?.ownerAccountID]);
const [chatReportOwnerPersonalDetail] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: chatReportOwnerSelector}, [chatReportOwnerSelector]);
const [reportOwnerPersonalDetail] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailsSelector(report?.ownerAccountID)});
const [chatReportOwnerPersonalDetail] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailsSelector(chatReport?.ownerAccountID)});
const delegateAccountID = useDelegateAccountID();

const [isLoading, setIsLoading] = useState(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function MoneyRequestReportPreviewProvider({
);
// Pass `transactionIDs` as a dependency so the selector re-runs once the transactions hydrate (otherwise
// it stays closed over the initial empty list and violations would never be selected on first load).
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {selector: selectTransactionViolations}, [transactionIDs]);
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {selector: selectTransactionViolations});
// `hasOnceLoadedReportActions` becomes true before transactions populate fully,
// so we defer the loading state update to ensure transactions are loaded
const shouldShowLoadingDeferred = useDeferredValue(shouldShowLoading);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import {personalDetailsLoginSelector} from '@src/selectors/PersonalDetails';
import {validTransactionDraftIDsSelector} from '@src/selectors/TransactionDraft';
import type {Report, Transaction} from '@src/types/onyx';
import type {PersonalDetailsList, Report, Transaction} from '@src/types/onyx';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';

import type {OnyxEntry} from 'react-native-onyx';
Expand Down Expand Up @@ -96,7 +96,10 @@ function ReportPreviewActionButton({
const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST);
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
const [iouReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${iouReportID}`);
const [ownerLogin] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailsLoginSelector(iouReport?.ownerAccountID)}, [iouReport?.ownerAccountID]);
const ownerAccountID = iouReport?.ownerAccountID;
const [ownerLogin] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {
selector: (personalDetailsList: OnyxEntry<PersonalDetailsList>) => personalDetailsLoginSelector(ownerAccountID)(personalDetailsList),
});
const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReportID}`);
const [userBillingGracePeriodEnds] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END);
const [ownerBillingGracePeriodEnd] = useOnyx(ONYXKEYS.NVP_PRIVATE_OWNER_BILLING_GRACE_PERIOD_END);
Expand Down
Loading
Loading