Skip to content

Commit ae4e0d2

Browse files
authored
Merge pull request #60851 from Expensify/issa-update-usage-of-ONYXKEYS_USER-to-ONYXKEYS_ACCOUNT-part1
Update all usage of User(ONYXKEYS.USER), to use Account(ONYXKEYS.ACCOUNT)
2 parents d196f8e + 0dc6555 commit ae4e0d2

File tree

26 files changed

+94
-89
lines changed

26 files changed

+94
-89
lines changed

src/components/AccountSwitcher.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ function AccountSwitcher() {
3838
const {shouldUseNarrowLayout} = useResponsiveLayout();
3939
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
4040
const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false});
41-
const [user] = useOnyx(ONYXKEYS.USER, {canBeMissing: true});
4241
const buttonRef = useRef<HTMLDivElement>(null);
4342
const {windowHeight} = useWindowDimensions();
4443
const {canUseLeftHandBar} = usePermissions();
@@ -184,7 +183,7 @@ function AccountSwitcher() {
184183
>
185184
{Str.removeSMSDomain(currentUserPersonalDetails?.login ?? '')}
186185
</Text>
187-
{!!user?.isDebugModeEnabled && (
186+
{!!account?.isDebugModeEnabled && (
188187
<Text
189188
style={[styles.textLabelSupporting, styles.mt1, styles.w100]}
190189
numberOfLines={1}

src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import tryResolveUrlFromApiRoot from '@libs/tryResolveUrlFromApiRoot';
1919
import CONST from '@src/CONST';
2020
import ONYXKEYS from '@src/ONYXKEYS';
2121
import ROUTES from '@src/ROUTES';
22-
import type {User} from '@src/types/onyx';
22+
import type {Account} from '@src/types/onyx';
2323

2424
type ImageRendererWithOnyxProps = {
25-
/** Current user */
25+
/** Current user account */
2626
// Following line is disabled because the onyx prop is only being used on the memo HOC
2727
// eslint-disable-next-line react/no-unused-prop-types
28-
user: OnyxEntry<User>;
28+
account: OnyxEntry<Account>;
2929
};
3030

3131
type ImageRendererProps = ImageRendererWithOnyxProps & CustomRendererProps<TBlock>;
@@ -41,7 +41,7 @@ function ImageRenderer({tnode}: ImageRendererProps) {
4141
//
4242
// - Chat Attachment images
4343
//
44-
// Images uploaded by the user via the app or email.
44+
// Images uploaded by the user account via the app or email.
4545
// These have a full-sized image `htmlAttribs[CONST.ATTACHMENT_SOURCE_ATTRIBUTE]`
4646
// and a thumbnail `htmlAttribs.src`. Both of these URLs need to have
4747
// an authToken added to them in order to control who
@@ -139,16 +139,16 @@ ImageRenderer.displayName = 'ImageRenderer';
139139

140140
const ImageRendererMemorize = memo(
141141
ImageRenderer,
142-
(prevProps, nextProps) => prevProps.tnode.attributes === nextProps.tnode.attributes && prevProps.user?.shouldUseStagingServer === nextProps.user?.shouldUseStagingServer,
142+
(prevProps, nextProps) => prevProps.tnode.attributes === nextProps.tnode.attributes && prevProps.account?.shouldUseStagingServer === nextProps.account?.shouldUseStagingServer,
143143
);
144144

145145
function ImageRendererWrapper(props: CustomRendererProps<TBlock>) {
146-
const [user] = useOnyx(ONYXKEYS.USER);
146+
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: false});
147147
return (
148148
<ImageRendererMemorize
149149
// eslint-disable-next-line react/jsx-props-no-spreading
150150
{...props}
151-
user={user}
151+
account={account}
152152
/>
153153
);
154154
}

src/components/Navigation/NavigationTabBar/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function NavigationTabBar({selectedTab, isTooltipAllowed = false, isTopLevelBar
5353
const {translate} = useLocalize();
5454
const {activeWorkspaceID} = useActiveWorkspace();
5555
const {orderedReportIDs} = useSidebarOrderedReportIDs();
56-
const [user] = useOnyx(ONYXKEYS.USER, {canBeMissing: false});
56+
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: false});
5757
const [reportActions] = useOnyx(ONYXKEYS.COLLECTION.REPORT_ACTIONS, {canBeMissing: true});
5858
const [reports = []] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {
5959
selector: (values) => orderedReportIDs.map((reportID) => values?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]),
@@ -71,7 +71,7 @@ function NavigationTabBar({selectedTab, isTooltipAllowed = false, isTopLevelBar
7171
const {canUseLeftHandBar} = usePermissions();
7272

7373
// On a wide layout DebugTabView should be rendered only within the navigation tab bar displayed directly on screens.
74-
const shouldRenderDebugTabViewOnWideLayout = !!user?.isDebugModeEnabled && !isTopLevelBar;
74+
const shouldRenderDebugTabViewOnWideLayout = !!account?.isDebugModeEnabled && !isTopLevelBar;
7575

7676
useEffect(() => {
7777
setChatTabBrickRoad(getChatTabBrickRoad(activeWorkspaceID, reports));
@@ -315,7 +315,7 @@ function NavigationTabBar({selectedTab, isTooltipAllowed = false, isTopLevelBar
315315

316316
return (
317317
<>
318-
{!!user?.isDebugModeEnabled && (
318+
{!!account?.isDebugModeEnabled && (
319319
<DebugTabView
320320
selectedTab={selectedTab}
321321
chatTabBrickRoad={chatTabBrickRoad}

src/components/TestToolMenu.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import {expireSessionWithDelay, invalidateAuthToken, invalidateCredentials} from
99
import {setIsDebugModeEnabled, setShouldUseStagingServer} from '@userActions/User';
1010
import CONFIG from '@src/CONFIG';
1111
import ONYXKEYS from '@src/ONYXKEYS';
12-
import type {User as UserOnyx} from '@src/types/onyx';
12+
import type {Account as AccountOnyx} from '@src/types/onyx';
1313
import Button from './Button';
1414
import Switch from './Switch';
1515
import TestCrash from './TestCrash';
1616
import TestToolRow from './TestToolRow';
1717
import Text from './Text';
1818

19-
const USER_DEFAULT: UserOnyx = {
19+
const ACCOUNT_DEFAULT: AccountOnyx = {
2020
shouldUseStagingServer: undefined,
2121
isSubscribedToNewsletter: false,
2222
validated: false,
@@ -26,11 +26,11 @@ const USER_DEFAULT: UserOnyx = {
2626
};
2727

2828
function TestToolMenu() {
29-
const [network] = useOnyx(ONYXKEYS.NETWORK);
30-
const [user = USER_DEFAULT] = useOnyx(ONYXKEYS.USER);
31-
const [isUsingImportedState] = useOnyx(ONYXKEYS.IS_USING_IMPORTED_STATE);
32-
const shouldUseStagingServer = user?.shouldUseStagingServer ?? isUsingStagingApi();
33-
const isDebugModeEnabled = !!user?.isDebugModeEnabled;
29+
const [network] = useOnyx(ONYXKEYS.NETWORK, {canBeMissing: true});
30+
const [account = ACCOUNT_DEFAULT] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
31+
const [isUsingImportedState] = useOnyx(ONYXKEYS.IS_USING_IMPORTED_STATE, {canBeMissing: true});
32+
const shouldUseStagingServer = account?.shouldUseStagingServer ?? isUsingStagingApi();
33+
const isDebugModeEnabled = !!account?.isDebugModeEnabled;
3434
const styles = useThemeStyles();
3535
const {translate} = useLocalize();
3636

src/libs/ApiUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ getEnvironment().then((envName) => {
1616

1717
// We connect here, so we have the updated ENV_NAME when Onyx callback runs
1818
Onyx.connect({
19-
key: ONYXKEYS.USER,
19+
key: ONYXKEYS.ACCOUNT,
2020
callback: (value) => {
2121
// Toggling between APIs is not allowed on production and internal dev environment
2222
if (ENV_NAME === CONST.ENVIRONMENT.PRODUCTION || CONFIG.IS_USING_LOCAL_WEB) {

src/libs/BankAccountUtils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {Str} from 'expensify-common';
22
import type {OnyxEntry} from 'react-native-onyx';
33
import type * as OnyxTypes from '@src/types/onyx';
44

5-
function getDefaultCompanyWebsite(session: OnyxEntry<OnyxTypes.Session>, user: OnyxEntry<OnyxTypes.User>): string {
6-
return user?.isFromPublicDomain ? '' : `https://www.${Str.extractEmailDomain(session?.email ?? '')}`;
5+
function getDefaultCompanyWebsite(session: OnyxEntry<OnyxTypes.Session>, account: OnyxEntry<OnyxTypes.Account>): string {
6+
return account?.isFromPublicDomain ? '' : `https://www.${Str.extractEmailDomain(session?.email ?? '')}`;
77
}
88

99
function getLastFourDigits(bankAccountNumber: string): string {

src/libs/Navigation/AppNavigator/Navigators/OnboardingModalNavigator.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ function OnboardingModalNavigator() {
3939
const styles = useThemeStyles();
4040
const {onboardingIsMediumOrLargerScreenWidth} = useResponsiveLayout();
4141
const outerViewRef = React.useRef<View>(null);
42-
const [user] = useOnyx(ONYXKEYS.USER, {canBeMissing: true});
42+
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
4343
const {canUsePrivateDomainOnboarding} = usePermissions();
4444

45-
const isOnPrivateDomainAndHasAccessiblePolicies = canUsePrivateDomainOnboarding && !user?.isFromPublicDomain && user?.hasAccessibleDomainPolicies;
45+
const isOnPrivateDomainAndHasAccessiblePolicies = canUsePrivateDomainOnboarding && !account?.isFromPublicDomain && account?.hasAccessibleDomainPolicies;
4646

4747
const [accountID] = useOnyx(ONYXKEYS.SESSION, {
4848
selector: (session) => session?.accountID ?? CONST.DEFAULT_NUMBER_ID,

src/libs/Navigation/NavigationRoot.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ function NavigationRoot({authenticated, lastVisitedPath, initialUrl, onReady}: N
9191

9292
const currentReportIDValue = useCurrentReportID();
9393
const {shouldUseNarrowLayout} = useResponsiveLayout();
94-
const [user] = useOnyx(ONYXKEYS.USER, {canBeMissing: true});
9594

9695
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
9796
const [isOnboardingCompleted = true] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {
@@ -112,7 +111,7 @@ function NavigationRoot({authenticated, lastVisitedPath, initialUrl, onReady}: N
112111
return getAdaptedStateFromPath(lastVisitedPath, linkingConfig.config);
113112
}
114113

115-
if (!user || user.isFromPublicDomain) {
114+
if (!account || account.isFromPublicDomain) {
116115
return;
117116
}
118117

src/libs/actions/App.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Onyx.connect({
100100

101101
let preservedShouldUseStagingServer: boolean | undefined;
102102
Onyx.connect({
103-
key: ONYXKEYS.USER,
103+
key: ONYXKEYS.ACCOUNT,
104104
callback: (value) => {
105105
preservedShouldUseStagingServer = value?.shouldUseStagingServer;
106106
},
@@ -618,7 +618,7 @@ function clearOnyxAndResetApp(shouldNavigateToHomepage?: boolean) {
618618
}
619619

620620
if (shouldUseStagingServer) {
621-
Onyx.set(ONYXKEYS.USER, {shouldUseStagingServer});
621+
Onyx.set(ONYXKEYS.ACCOUNT, {shouldUseStagingServer});
622622
}
623623
})
624624
.then(() => {

src/libs/actions/Session/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ function signInAfterTransitionFromOldDot(hybridAppSettings: string) {
612612
classicRedirect: {completedHybridAppOnboarding},
613613
nudgeMigration: nudgeMigrationTimestamp ? {timestamp: new Date(nudgeMigrationTimestamp)} : undefined,
614614
},
615-
[ONYXKEYS.USER]: {shouldUseStagingServer: isStaging},
615+
[ONYXKEYS.ACCOUNT]: {shouldUseStagingServer: isStaging},
616616
}).then(() => Onyx.merge(ONYXKEYS.ACCOUNT, {primaryLogin, requiresTwoFactorAuth, needsTwoFactorAuthSetup})),
617617
)
618618
.then(() => {

src/libs/actions/User.ts

+5-12
Original file line numberDiff line numberDiff line change
@@ -187,20 +187,20 @@ function requestContactMethodValidateCode(contactMethod: string) {
187187
}
188188

189189
/**
190-
* Sets whether the user is subscribed to Expensify news
190+
* Sets whether the user account is subscribed to Expensify news
191191
*/
192192
function updateNewsletterSubscription(isSubscribed: boolean) {
193193
const optimisticData: OnyxUpdate[] = [
194194
{
195195
onyxMethod: Onyx.METHOD.MERGE,
196-
key: ONYXKEYS.USER,
196+
key: ONYXKEYS.ACCOUNT,
197197
value: {isSubscribedToNewsletter: isSubscribed},
198198
},
199199
];
200200
const failureData: OnyxUpdate[] = [
201201
{
202202
onyxMethod: Onyx.METHOD.MERGE,
203-
key: ONYXKEYS.USER,
203+
key: ONYXKEYS.ACCOUNT,
204204
value: {isSubscribedToNewsletter: !isSubscribed},
205205
},
206206
];
@@ -522,13 +522,6 @@ function validateSecondaryLogin(loginList: OnyxEntry<LoginList>, contactMethod:
522522
validated: true,
523523
},
524524
},
525-
{
526-
onyxMethod: Onyx.METHOD.MERGE,
527-
key: ONYXKEYS.USER,
528-
value: {
529-
validated: true,
530-
},
531-
},
532525
];
533526
// If the primary login isn't validated yet, set the secondary login as the primary login
534527
if (!loginList?.[currentEmail].validatedDate) {
@@ -1018,7 +1011,7 @@ function setShouldUseStagingServer(shouldUseStagingServer: boolean) {
10181011
if (CONFIG.IS_HYBRID_APP) {
10191012
HybridAppModule.shouldUseStaging(shouldUseStagingServer);
10201013
}
1021-
Onyx.merge(ONYXKEYS.USER, {shouldUseStagingServer});
1014+
Onyx.merge(ONYXKEYS.ACCOUNT, {shouldUseStagingServer});
10221015
}
10231016

10241017
function togglePlatformMute(platform: Platform, mutedPlatforms: Partial<Record<Platform, true>>) {
@@ -1384,7 +1377,7 @@ function requestRefund() {
13841377
}
13851378

13861379
function setIsDebugModeEnabled(isDebugModeEnabled: boolean) {
1387-
Onyx.merge(ONYXKEYS.USER, {isDebugModeEnabled});
1380+
Onyx.merge(ONYXKEYS.ACCOUNT, {isDebugModeEnabled});
13881381
}
13891382

13901383
export {

src/libs/actions/Welcome/OnboardingFlow.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import CONST from '@src/CONST';
99
import NAVIGATORS from '@src/NAVIGATORS';
1010
import ONYXKEYS from '@src/ONYXKEYS';
1111
import ROUTES from '@src/ROUTES';
12+
import type Account from '@src/types/onyx/Account';
1213
import type Onboarding from '@src/types/onyx/Onboarding';
13-
import type User from '@src/types/onyx/User';
1414

1515
let onboardingInitialPath = '';
1616
const onboardingLastVisitedPathConnection = Onyx.connect({
@@ -35,14 +35,14 @@ Onyx.connect({
3535
},
3636
});
3737

38-
let user: User;
38+
let userAccount: Account;
3939
Onyx.connect({
40-
key: ONYXKEYS.USER,
40+
key: ONYXKEYS.ACCOUNT,
4141
callback: (value) => {
4242
if (value === undefined) {
4343
return;
4444
}
45-
user = value;
45+
userAccount = value;
4646
},
4747
});
4848

@@ -65,7 +65,7 @@ function startOnboardingFlow(isPrivateDomain?: boolean) {
6565

6666
function getOnboardingInitialPath(isPrivateDomain?: boolean): string {
6767
const state = getStateFromPath(onboardingInitialPath, linkingConfig.config);
68-
const isUserFromPublicDomain = user?.isFromPublicDomain;
68+
const isUserFromPublicDomain = userAccount?.isFromPublicDomain;
6969
const isVsb = onboardingValues && 'signupQualifier' in onboardingValues && onboardingValues.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB;
7070
const isSmb = onboardingValues && 'signupQualifier' in onboardingValues && onboardingValues.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.SMB;
7171
const isIndividual = onboardingValues && 'signupQualifier' in onboardingValues && onboardingValues.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.INDIVIDUAL;

src/pages/OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat
3737
const [onboardingPurposeSelected] = useOnyx(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, {canBeMissing: true});
3838
const [onboardingPolicyID] = useOnyx(ONYXKEYS.ONBOARDING_POLICY_ID, {canBeMissing: true});
3939
const [onboardingAdminsChatReportID] = useOnyx(ONYXKEYS.ONBOARDING_ADMINS_CHAT_REPORT_ID, {canBeMissing: true});
40-
const [user] = useOnyx(ONYXKEYS.USER, {canBeMissing: true});
40+
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
4141
const [loginList] = useOnyx(ONYXKEYS.LOGIN_LIST, {canBeMissing: true});
4242
const [onboardingValues] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {canBeMissing: true});
4343
const [conciergeChatReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID, {canBeMissing: true});
@@ -52,7 +52,7 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat
5252
const {canUseDefaultRooms, canUsePrivateDomainOnboarding} = usePermissions();
5353
const {activeWorkspaceID} = useActiveWorkspace();
5454

55-
const isPrivateDomainAndHasAccesiblePolicies = canUsePrivateDomainOnboarding && !user?.isFromPublicDomain && !!user?.hasAccessibleDomainPolicies;
55+
const isPrivateDomainAndHasAccesiblePolicies = canUsePrivateDomainOnboarding && !account?.isFromPublicDomain && !!account?.hasAccessibleDomainPolicies;
5656
const isValidated = isCurrentUserValidated(loginList);
5757

5858
useEffect(() => {

src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ function BaseOnboardingPurpose({shouldUseNativeStyles, shouldEnableMaxHeight, ro
5454
const {onboardingIsMediumOrLargerScreenWidth} = useResponsiveLayout();
5555
const {windowHeight} = useWindowDimensions();
5656
const {canUsePrivateDomainOnboarding} = usePermissions();
57-
const [user] = useOnyx(ONYXKEYS.USER, {canBeMissing: true});
57+
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
5858

59-
const isPrivateDomainAndHasAccesiblePolicies = canUsePrivateDomainOnboarding && !user?.isFromPublicDomain && !!user?.hasAccessibleDomainPolicies;
59+
const isPrivateDomainAndHasAccesiblePolicies = canUsePrivateDomainOnboarding && !account?.isFromPublicDomain && !!account?.hasAccessibleDomainPolicies;
6060

6161
// We need to use isSmallScreenWidth instead of shouldUseNarrowLayout to show offline indicator on small screen only
6262
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth

src/pages/ProfilePage.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ function ProfilePage({route}: ProfilePageProps) {
6969
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {canBeMissing: true});
7070
const [personalDetailsMetadata] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_METADATA, {canBeMissing: true});
7171
const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false});
72-
const [isDebugModeEnabled] = useOnyx(ONYXKEYS.USER, {selector: (user) => !!user?.isDebugModeEnabled, canBeMissing: true});
72+
const [isDebugModeEnabled] = useOnyx(ONYXKEYS.ACCOUNT, {
73+
selector: (account) => !!account?.isDebugModeEnabled,
74+
canBeMissing: true,
75+
});
7376
const [guideCalendarLink] = useOnyx(ONYXKEYS.ACCOUNT, {
7477
selector: (account) => account?.guideCalendarLink,
7578
canBeMissing: true,

src/pages/ReimbursementAccount/USD/BusinessInfo/subSteps/WebsiteBusiness.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ const STEP_FIELDS = [COMPANY_WEBSITE_KEY];
2020

2121
function WebsiteBusiness({onNext, onMove, isEditing}: SubStepProps) {
2222
const {translate} = useLocalize();
23-
const [reimbursementAccount, reimbursementAccountResult] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT);
23+
const [reimbursementAccount, reimbursementAccountResult] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {canBeMissing: true});
2424
const isLoadingReimbursementAccount = isLoadingOnyxValue(reimbursementAccountResult);
25-
const [session] = useOnyx(ONYXKEYS.SESSION);
26-
const [user] = useOnyx(ONYXKEYS.USER);
25+
const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: true});
26+
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
2727

28-
const defaultWebsiteExample = useMemo(() => getDefaultCompanyWebsite(session, user), [session, user]);
28+
const defaultWebsiteExample = useMemo(() => getDefaultCompanyWebsite(session, account), [session, account]);
2929
const defaultCompanyWebsite = reimbursementAccount?.achData?.website ?? defaultWebsiteExample;
3030

3131
const validate = useCallback(

src/pages/ReportDetailsPage.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function ReportDetailsPage({policies, report, route, reportMetadata}: ReportDeta
195195

196196
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
197197
const [transactionThreadReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID}`, {canBeMissing: true});
198-
const [isDebugModeEnabled] = useOnyx(ONYXKEYS.USER, {selector: (user) => !!user?.isDebugModeEnabled, canBeMissing: false});
198+
const [isDebugModeEnabled] = useOnyx(ONYXKEYS.ACCOUNT, {selector: (account) => !!account?.isDebugModeEnabled, canBeMissing: false});
199199
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {canBeMissing: false});
200200
const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false});
201201
const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {

src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function BaseReportActionContextMenu({
145145
});
146146
const transactionID = getLinkedTransactionID(reportActionID, reportID);
147147
const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {canBeMissing: false});
148-
const [user] = useOnyx(ONYXKEYS.USER, {canBeMissing: false});
148+
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: false});
149149
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {canBeMissing: false});
150150
const [originalReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${originalReportID}`, {canBeMissing: false});
151151
const isOriginalReportArchived = useReportIsArchived(originalReportID);
@@ -222,7 +222,7 @@ function BaseReportActionContextMenu({
222222
isProduction,
223223
moneyRequestAction,
224224
areHoldRequirementsMet,
225-
user,
225+
account,
226226
}),
227227
);
228228

0 commit comments

Comments
 (0)