From 31eb7864c168d9a09fc3887544c8fe8ac00fc749 Mon Sep 17 00:00:00 2001 From: Mykhailo <97676131+mkhutornyi@users.noreply.github.com> Date: Tue, 7 Apr 2026 02:57:10 -0300 Subject: [PATCH] Revert "[Onyx Audit] Migrate keys to RAM-only part 2/2" --- src/DelegateAccessHandler.tsx | 2 +- src/ONYXKEYS.ts | 24 ++++++------- src/components/AddPlaidBankAccount.tsx | 13 +++---- src/components/LocaleContextProvider.tsx | 2 +- .../MoneyRequestReportView.tsx | 2 +- src/components/PriorityModeController.tsx | 2 +- .../ProductTrainingContext/index.tsx | 2 +- .../ListItem/TransactionGroupListExpanded.tsx | 2 +- src/hooks/useMobileSelectionMode.ts | 2 +- src/hooks/useOnboardingFlow.ts | 2 +- src/hooks/useSearchBackPress/index.android.ts | 2 +- src/languages/IntlStore.ts | 2 +- .../AppNavigator/AuthScreensInitHandler.tsx | 4 +-- src/libs/Navigation/guards/index.ts | 2 +- src/libs/PersonalDetailsUtils.ts | 2 +- src/libs/ReportUtils.ts | 3 +- src/libs/actions/App.ts | 29 +++++++-------- src/libs/actions/Card.ts | 18 +++++----- src/libs/actions/Delegate.ts | 4 +-- src/libs/actions/MobileSelectionMode.ts | 4 +-- src/libs/actions/OnyxDerived/index.ts | 3 +- src/libs/actions/OnyxUpdateManager/index.ts | 2 +- src/libs/actions/QueuedOnyxUpdates.ts | 6 ++-- src/libs/actions/Session/index.ts | 4 +-- src/libs/actions/SignInRedirect.ts | 2 +- src/libs/actions/Wallet.ts | 22 +----------- src/libs/actions/Welcome/index.ts | 3 +- src/pages/ConciergePage.tsx | 2 +- .../EnablePayments/EnablePaymentsPage.tsx | 36 ++++++------------- src/pages/NewReportWorkspaceSelectionPage.tsx | 2 +- .../ReimbursementAccountPage.tsx | 2 +- src/pages/ReportChangeWorkspacePage.tsx | 2 +- .../SearchFiltersWorkspacePage.tsx | 2 +- .../Search/SearchMoneyRequestReportPage.tsx | 2 +- src/pages/SetDefaultWorkspacePage.tsx | 2 +- src/pages/ValidateLoginPage/index.website.tsx | 19 ++++------ src/pages/home/ForYouSection/index.tsx | 4 +-- src/pages/home/HomePage.tsx | 4 +-- src/pages/inbox/ReportFetchHandler.tsx | 4 +-- src/pages/inbox/ReportNotFoundGuard.tsx | 4 +-- src/pages/inbox/report/ReportActionsView.tsx | 2 +- .../withReportAndReportActionOrNotFound.tsx | 2 +- .../inbox/report/withReportOrNotFound.tsx | 2 +- src/pages/inbox/sidebar/BaseSidebarScreen.tsx | 4 +-- .../menuItems/NewWorkspaceMenuItem.tsx | 2 +- .../sidebar/ProfileAvatarWithIndicator.tsx | 2 +- src/pages/inbox/sidebar/SidebarLinks.tsx | 2 +- .../step/withWritableReportOrNotFound.tsx | 2 +- .../routes/ProfileAvatarModalContent.tsx | 2 +- .../routes/WorkspaceAvatarModalContent.tsx | 2 +- .../ReportAddAttachmentModalContent/index.tsx | 2 +- .../report/ReportAttachmentModalContent.tsx | 2 +- .../report/ReportAvatarModalContent.tsx | 2 +- .../Contacts/ContactMethodDetailsPage.tsx | 2 +- .../settings/Profile/DisplayNamePage.tsx | 2 +- .../PersonalDetails/BaseLegalNamePage.tsx | 2 +- .../PersonalDetails/DateOfBirthPage.tsx | 2 +- .../PersonalDetails/PersonalAddressPage.tsx | 2 +- .../PersonalDetails/PhoneNumberPage.tsx | 2 +- src/pages/settings/Profile/ProfilePage.tsx | 2 +- src/pages/settings/Profile/PronounsPage.tsx | 2 +- .../Subscription/SubscriptionSettingsPage.tsx | 2 +- .../settings/Wallet/WalletPage/index.tsx | 2 +- .../workspace/AccessOrNotFoundWrapper.tsx | 2 +- src/pages/workspace/WorkspacesListPage.tsx | 2 +- .../expensifyCard/issueNew/AssigneeStep.tsx | 2 +- .../expensifyCard/issueNew/CardNameStep.tsx | 2 +- .../expensifyCard/issueNew/CardTypeStep.tsx | 2 +- .../issueNew/ConfirmationStep.tsx | 2 +- .../issueNew/InviteNewMemberStep.tsx | 2 +- .../IssueNewCardConfirmMagicCodePage.tsx | 2 +- .../issueNew/IssueNewCardPage.tsx | 2 +- .../expensifyCard/issueNew/LimitTypeStep.tsx | 2 +- .../issueNew/SetExpiryOptionsStep.tsx | 2 +- .../withPolicyAndFullscreenLoading.tsx | 2 +- src/setup/index.ts | 8 +---- src/types/onyx/UserWallet.ts | 3 -- tests/actions/QueuedOnyxUpdatesTest.ts | 16 ++++----- tests/actions/ReportTest.ts | 6 ++-- tests/perf-test/SidebarLinks.perf-test.tsx | 4 +-- tests/ui/AddressPageTest.tsx | 6 ++-- tests/ui/AuthScreensInitHandlerTest.tsx | 4 +-- tests/ui/ForYouSectionTest.tsx | 2 +- tests/ui/GroupChatNameTests.tsx | 2 +- tests/ui/LHNItemsPresence.tsx | 2 +- tests/ui/PaginationTest.tsx | 2 +- tests/ui/ProfilePageTest.tsx | 4 +-- tests/ui/ReportActionsViewTest.tsx | 24 ++++++------- tests/ui/ReportAttachments.tsx | 2 +- tests/ui/SessionTest.tsx | 2 +- tests/ui/UnreadIndicatorsTest.tsx | 2 +- ...orkspaceWorkflowsApprovalsEditPageTest.tsx | 2 +- .../ProductTrainingContextProvider.tsx | 4 +-- tests/unit/ContactMethodDetailsPageTest.tsx | 2 +- tests/unit/LocalizeTests.ts | 2 +- tests/unit/OnyxDerivedTest.tsx | 2 +- tests/unit/ReportActionItemSingleTest.ts | 2 +- tests/unit/SidebarOrderTest.ts | 36 +++++++++---------- tests/unit/SidebarTest.ts | 4 +-- 99 files changed, 209 insertions(+), 256 deletions(-) diff --git a/src/DelegateAccessHandler.tsx b/src/DelegateAccessHandler.tsx index e1477201bd7c..b3683c672cf9 100644 --- a/src/DelegateAccessHandler.tsx +++ b/src/DelegateAccessHandler.tsx @@ -22,7 +22,7 @@ function DelegateAccessHandler() { const [stashedCredentials = CONST.EMPTY_OBJECT] = useOnyx(ONYXKEYS.STASHED_CREDENTIALS); const [stashedSession] = useOnyx(ONYXKEYS.STASHED_SESSION); const [hasLoadedApp] = useOnyx(ONYXKEYS.HAS_LOADED_APP); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [sessionAccountID] = useOnyx(ONYXKEYS.SESSION, {selector: accountIDSelector}); const [sessionEmail] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector}); const {isOffline} = useNetwork(); diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index a40f170a5f5b..80bf3acf5d24 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -31,7 +31,7 @@ const ONYXKEYS = { DEVICE_ID: 'deviceID', /** Boolean flag set whenever the sidebar has loaded */ - RAM_ONLY_IS_SIDEBAR_LOADED: 'isSidebarLoaded', + IS_SIDEBAR_LOADED: 'isSidebarLoaded', /** Boolean flag set whenever we are searching for reports in the server */ RAM_ONLY_IS_SEARCHING_FOR_REPORTS: 'isSearchingForReports', @@ -210,7 +210,7 @@ const ONYXKEYS = { NVP_PREFERRED_LOCALE: 'nvp_preferredLocale', /** Whether the app is currently loading a translation */ - RAM_ONLY_ARE_TRANSLATIONS_LOADING: 'areTranslationsLoading', + ARE_TRANSLATIONS_LOADING: 'areTranslationsLoading', /** Whether the user has tried focus mode yet */ NVP_TRY_FOCUS_MODE: 'nvp_tryFocusMode', @@ -373,7 +373,7 @@ const ONYXKEYS = { SHARE_BANK_ACCOUNT: 'shareBankAccount', /** Is report data loading? */ - RAM_ONLY_IS_LOADING_REPORT_DATA: 'isLoadingReportData', + IS_LOADING_REPORT_DATA: 'isLoadingReportData', /** Set when we are loading bank accounts for share page */ IS_LOADING_SHARE_BANK_ACCOUNTS: 'isLoadingShareBankAccounts', @@ -382,7 +382,7 @@ const ONYXKEYS = { IS_LOADING_BULK_CHANGE_APPROVER_PAGE: 'isLoadingBulkChangeApproverPage', /** Is report data loading? */ - RAM_ONLY_IS_LOADING_APP: 'isLoadingApp', + IS_LOADING_APP: 'isLoadingApp', /** Is loading policy rules preview? */ IS_LOADING_POLICY_CODING_RULES_PREVIEW: 'isLoadingPolicyCodingRulesPreview', @@ -541,7 +541,7 @@ const ONYXKEYS = { ASSIGN_CARD: 'assignCard', /** Stores the information if mobile selection mode is active */ - RAM_ONLY_MOBILE_SELECTION_MODE: 'mobileSelectionMode', + MOBILE_SELECTION_MODE: 'mobileSelectionMode', NVP_PRIVATE_CANCELLATION_DETAILS: 'nvp_private_cancellationDetails', @@ -796,7 +796,7 @@ const ONYXKEYS = { NVP_EXPENSIFY_REPORT_PDF_FILENAME: 'nvp_expensify_report_PDFFilename_', /** Stores the information about the state of issuing a new card */ - RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD: 'issueNewExpensifyCard_', + ISSUE_NEW_EXPENSIFY_CARD: 'issueNewExpensifyCard_', /** Used for identifying user as admin of a domain */ SHARED_NVP_PRIVATE_ADMIN_ACCESS: 'sharedNVP_private_admin_access_', @@ -1275,7 +1275,7 @@ type OnyxCollectionValuesMapping = { [ONYXKEYS.COLLECTION.LAST_SELECTED_FEED]: OnyxTypes.CompanyCardFeedWithDomainID; [ONYXKEYS.COLLECTION.LAST_SELECTED_EXPENSIFY_CARD_FEED]: OnyxTypes.FundID; [ONYXKEYS.COLLECTION.NVP_EXPENSIFY_ON_CARD_WAITLIST]: OnyxTypes.CardOnWaitlist; - [ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD]: OnyxTypes.IssueNewCard; + [ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD]: OnyxTypes.IssueNewCard; [ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_ADMIN_ACCESS]: boolean; [ONYXKEYS.COLLECTION.SAML_METADATA]: OnyxTypes.SamlMetadata; [ONYXKEYS.COLLECTION.DOMAIN_PENDING_ACTIONS]: OnyxTypes.DomainPendingActions; @@ -1299,7 +1299,7 @@ type OnyxValuesMapping = { [ONYXKEYS.RECENTLY_USED_CURRENCIES]: string[]; [ONYXKEYS.ACTIVE_CLIENTS]: string[]; [ONYXKEYS.DEVICE_ID]: string; - [ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED]: boolean; + [ONYXKEYS.IS_SIDEBAR_LOADED]: boolean; [ONYXKEYS.PERSISTED_REQUESTS]: OnyxTypes.AnyRequest[]; [ONYXKEYS.PERSISTED_ONGOING_REQUESTS]: OnyxTypes.AnyRequest; [ONYXKEYS.CURRENT_DATE]: string; @@ -1366,7 +1366,7 @@ type OnyxValuesMapping = { [ONYXKEYS.ONFIDO_TOKEN]: string; [ONYXKEYS.ONFIDO_APPLICANT_ID]: string; [ONYXKEYS.NVP_PREFERRED_LOCALE]: OnyxTypes.Locale; - [ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING]: boolean; + [ONYXKEYS.ARE_TRANSLATIONS_LOADING]: boolean; [ONYXKEYS.NVP_ACTIVE_POLICY_ID]: string; [ONYXKEYS.NVP_DISMISSED_REFERRAL_BANNERS]: OnyxTypes.DismissedReferralBanners; [ONYXKEYS.NVP_HAS_SEEN_TRACK_TRAINING]: boolean; @@ -1399,12 +1399,12 @@ type OnyxValuesMapping = { [ONYXKEYS.IS_LOADING_SHARE_BANK_ACCOUNTS]: boolean; [ONYXKEYS.IS_LOADING_BULK_CHANGE_APPROVER_PAGE]: boolean; [ONYXKEYS.IS_LOADING_POLICY_CODING_RULES_PREVIEW]: boolean; - [ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA]: boolean; [ONYXKEYS.IS_SEARCH_FILTERS_CARD_DATA_LOADED]: boolean; [ONYXKEYS.IS_LOADING_SUBSCRIPTION_DATA]: boolean; [ONYXKEYS.IS_SEARCH_PAGE_DATA_LOADED]: boolean; + [ONYXKEYS.IS_LOADING_REPORT_DATA]: boolean; [ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN]: boolean; - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: boolean; + [ONYXKEYS.IS_LOADING_APP]: boolean; [ONYXKEYS.HAS_LOADED_APP]: boolean; [ONYXKEYS.WALLET_TRANSFER]: OnyxTypes.WalletTransfer; [ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID]: string; @@ -1452,7 +1452,7 @@ type OnyxValuesMapping = { [ONYXKEYS.ADD_NEW_COMPANY_CARD]: OnyxTypes.AddNewCompanyCardFeed; [ONYXKEYS.ADD_NEW_PERSONAL_CARD]: OnyxTypes.AddNewPersonalCard; [ONYXKEYS.ASSIGN_CARD]: OnyxTypes.AssignCard; - [ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE]: boolean; + [ONYXKEYS.MOBILE_SELECTION_MODE]: boolean; [ONYXKEYS.DUPLICATE_WORKSPACE]: OnyxTypes.DuplicateWorkspace; [ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL]: string; [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: string; diff --git a/src/components/AddPlaidBankAccount.tsx b/src/components/AddPlaidBankAccount.tsx index fc011a18ee2a..c68624505d5a 100644 --- a/src/components/AddPlaidBankAccount.tsx +++ b/src/components/AddPlaidBankAccount.tsx @@ -83,19 +83,18 @@ function AddPlaidBankAccount({ const subscribedKeyboardShortcuts = useRef void>>([]); const previousNetworkState = useRef(undefined); const [selectedPlaidAccountMask, setSelectedPlaidAccountMask] = useState(defaultSelectedPlaidAccountMask); - const [plaidLinkToken] = useOnyx(ONYXKEYS.PLAID_LINK_TOKEN); - const [isPlaidTokenReady, setIsPlaidTokenReady] = useState(false); + const [plaidLinkToken] = useOnyx(ONYXKEYS.PLAID_LINK_TOKEN, {initWithStoredValues: false}); const [isPlaidDisabled] = useOnyx(ONYXKEYS.IS_PLAID_DISABLED); const {translate} = useLocalize(); const {isOffline} = useNetwork(); const getPlaidLinkToken = (): string | undefined => { - if (receivedRedirectURI && plaidLinkOAuthToken) { - return plaidLinkOAuthToken; + if (plaidLinkToken) { + return plaidLinkToken; } - if (isPlaidTokenReady && plaidLinkToken) { - return plaidLinkToken; + if (receivedRedirectURI && plaidLinkOAuthToken) { + return plaidLinkOAuthToken; } }; @@ -141,11 +140,9 @@ function AddPlaidBankAccount({ // If we're coming from Plaid OAuth flow then we need to reuse the existing plaidLinkToken if (isAuthenticatedWithPlaid()) { - setIsPlaidTokenReady(true); return unsubscribeToNavigationShortcuts; } openPlaidBankLogin(allowDebit, bankAccountID); - setIsPlaidTokenReady(true); return unsubscribeToNavigationShortcuts; // disabling this rule, as we want this to run only on the first render diff --git a/src/components/LocaleContextProvider.tsx b/src/components/LocaleContextProvider.tsx index 268c9968ff34..c11d6943463d 100644 --- a/src/components/LocaleContextProvider.tsx +++ b/src/components/LocaleContextProvider.tsx @@ -85,7 +85,7 @@ const COLLATOR_OPTIONS: Intl.CollatorOptions = {usage: 'sort', sensitivity: 'var function LocaleContextProvider({children}: LocaleContextProviderProps) { const currentUserPersonalDetails = useCurrentUserPersonalDetails(); - const [areTranslationsLoading = true] = useOnyx(ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING); + const [areTranslationsLoading = true] = useOnyx(ONYXKEYS.ARE_TRANSLATIONS_LOADING, {initWithStoredValues: false}); const [countryCodeByIP = 1] = useOnyx(ONYXKEYS.COUNTRY_CODE); const [nvpPreferredLocale, nvpPreferredLocaleMetadata] = useOnyx(ONYXKEYS.NVP_PREFERRED_LOCALE); const [currentLocale, setCurrentLocale] = useState(() => IntlStore.getCurrentLocale()); diff --git a/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx b/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx index 1a5688c13721..a4c1b2bfda36 100644 --- a/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx +++ b/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx @@ -116,7 +116,7 @@ function MoneyRequestReportView({report, policy, reportMetadata, shouldDisplayRe const {isSmallScreenWidth} = useResponsiveLayout(); const reportID = report?.reportID; - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const {reportPendingAction, reportErrors} = getReportOfflinePendingActionAndErrors(report); const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(report?.chatReportID)}`); diff --git a/src/components/PriorityModeController.tsx b/src/components/PriorityModeController.tsx index 02b3ec8b3609..bbed955ea936 100644 --- a/src/components/PriorityModeController.tsx +++ b/src/components/PriorityModeController.tsx @@ -30,7 +30,7 @@ const isInFocusModeSelector = (priorityMode: OnyxEntry({ }); function ProductTrainingContextProvider({children}: ChildrenProps) { - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [tryNewDot] = useOnyx(ONYXKEYS.NVP_TRY_NEW_DOT); const hasBeenAddedToNudgeMigration = !!tryNewDot?.nudgeMigration?.timestamp; const [isOnboardingCompleted = true, isOnboardingCompletedMetadata] = useOnyx(ONYXKEYS.NVP_ONBOARDING, { diff --git a/src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx b/src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx index 19067bb6ade7..30771565a0a0 100644 --- a/src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx +++ b/src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx @@ -60,7 +60,7 @@ function TransactionGroupListExpanded({ const {windowWidth} = useWindowDimensions(); const currentUserDetails = useCurrentUserPersonalDetails(); const {translate} = useLocalize(); - const [isMobileSelectionModeEnabled] = useOnyx(ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE); + const [isMobileSelectionModeEnabled] = useOnyx(ONYXKEYS.MOBILE_SELECTION_MODE); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [betas] = useOnyx(ONYXKEYS.BETAS); const [visibleColumns] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM, {selector: columnsSelector}); diff --git a/src/hooks/useMobileSelectionMode.ts b/src/hooks/useMobileSelectionMode.ts index 6a75424c74e4..51f13dc21653 100644 --- a/src/hooks/useMobileSelectionMode.ts +++ b/src/hooks/useMobileSelectionMode.ts @@ -5,7 +5,7 @@ import useOnyx from './useOnyx'; import usePrevious from './usePrevious'; export default function useMobileSelectionMode(onTurnOffSelectionMode = () => {}) { - const [isSelectionModeEnabled = false] = useOnyx(ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE); + const [isSelectionModeEnabled = false] = useOnyx(ONYXKEYS.MOBILE_SELECTION_MODE, {initWithStoredValues: false}); const initialSelectionModeValueRef = useRef(isSelectionModeEnabled); const prevIsSelectionModeEnabled = usePrevious(isSelectionModeEnabled); diff --git a/src/hooks/useOnboardingFlow.ts b/src/hooks/useOnboardingFlow.ts index c051b4d90063..0a70def30062 100644 --- a/src/hooks/useOnboardingFlow.ts +++ b/src/hooks/useOnboardingFlow.ts @@ -19,7 +19,7 @@ import useOnyx from './useOnyx'; */ function useOnboardingFlowRouter() { const currentUrl = getCurrentUrl(); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [onboardingValues, isOnboardingCompletedMetadata] = useOnyx(ONYXKEYS.NVP_ONBOARDING); const [sessionEmail] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector}); const isLoggingInAsNewSessionUser = isLoggingInAsNewUser(currentUrl, sessionEmail); diff --git a/src/hooks/useSearchBackPress/index.android.ts b/src/hooks/useSearchBackPress/index.android.ts index b6880b4cd5a9..4e677b0b7620 100644 --- a/src/hooks/useSearchBackPress/index.android.ts +++ b/src/hooks/useSearchBackPress/index.android.ts @@ -7,7 +7,7 @@ import ONYXKEYS from '@src/ONYXKEYS'; import type UseSearchBackPress from './types'; const useSearchBackPress: UseSearchBackPress = ({onClearSelection, onNavigationCallBack}) => { - const [selectionMode] = useOnyx(ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE); + const [selectionMode] = useOnyx(ONYXKEYS.MOBILE_SELECTION_MODE); useFocusEffect( useCallback(() => { const onBackPress = () => { diff --git a/src/languages/IntlStore.ts b/src/languages/IntlStore.ts index b4870c4fb813..345ccefb887a 100644 --- a/src/languages/IntlStore.ts +++ b/src/languages/IntlStore.ts @@ -24,7 +24,7 @@ import type zhHans from './zh-hans'; // This function was added here to avoid circular dependencies function setAreTranslationsLoading(areTranslationsLoading: boolean) { // eslint-disable-next-line rulesdir/prefer-actions-set-data - Onyx.set(ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, areTranslationsLoading); + Onyx.set(ONYXKEYS.ARE_TRANSLATIONS_LOADING, areTranslationsLoading); } class IntlStore { diff --git a/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx b/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx index fa1a09f60e4c..ee2d18c3e942 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx @@ -43,7 +43,7 @@ function initializePusher(currentUserAccountID?: number, getReportAttributes?: ( * Extracted from AuthScreens to isolate useOnyx subscriptions: * - SESSION, NVP_INTRO_SELECTED, NVP_ACTIVE_POLICY_ID, * NVP_ONBOARDING (tour selector), ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT (x2), - * RAM_ONLY_IS_LOADING_APP + * IS_LOADING_APP */ function AuthScreensInitHandler() { const currentUrl = getCurrentUrl(); @@ -59,7 +59,7 @@ function AuthScreensInitHandler() { const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector}); const [lastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const lastUpdateIDAppliedToClientRef = useRef(lastUpdateIDAppliedToClient); const isLoadingAppRef = useRef(isLoadingApp); diff --git a/src/libs/Navigation/guards/index.ts b/src/libs/Navigation/guards/index.ts index 5dccdf56978d..33851c2907cc 100644 --- a/src/libs/Navigation/guards/index.ts +++ b/src/libs/Navigation/guards/index.ts @@ -23,7 +23,7 @@ Onyx.connectWithoutView({ }); Onyx.connectWithoutView({ - key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + key: ONYXKEYS.IS_LOADING_APP, callback: (value) => { isLoadingApp = value ?? true; }, diff --git a/src/libs/PersonalDetailsUtils.ts b/src/libs/PersonalDetailsUtils.ts index 6f0dbdb582c6..91a0544b6afe 100644 --- a/src/libs/PersonalDetailsUtils.ts +++ b/src/libs/PersonalDetailsUtils.ts @@ -41,7 +41,7 @@ let hiddenTranslation = ''; let youTranslation = ''; Onyx.connect({ - key: ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, + key: ONYXKEYS.ARE_TRANSLATIONS_LOADING, callback: (value) => { if (value ?? true) { return; diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index bb85cd67d79e..b8fdc53bf852 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1255,7 +1255,8 @@ let hiddenTranslation = ''; let unavailableTranslation = ''; Onyx.connect({ - key: ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, + key: ONYXKEYS.ARE_TRANSLATIONS_LOADING, + initWithStoredValues: false, callback: (value) => { if (value ?? true) { return; diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index 912fef8112bd..111177762bd1 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -52,8 +52,9 @@ Onyx.connectWithoutView({ // `useOnyx` would trigger extra rerenders without affecting the View, so `Onyx.connectWithoutView` is used instead let isSidebarLoaded: boolean | undefined; Onyx.connectWithoutView({ - key: ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, + key: ONYXKEYS.IS_SIDEBAR_LOADED, callback: (val) => (isSidebarLoaded = val), + initWithStoredValues: false, }); // `isUsingImportedState` is used in `openApp`, `reconnectApp`, and `clearOnyxAndResetApp` to prevent API calls when using imported state. @@ -120,9 +121,9 @@ Onyx.connectWithoutView({ const KEYS_TO_PRESERVE: OnyxKey[] = [ ONYXKEYS.ACCOUNT, - ONYXKEYS.RAM_ONLY_IS_LOADING_APP, - ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, + ONYXKEYS.IS_LOADING_APP, + ONYXKEYS.IS_SIDEBAR_LOADED, ONYXKEYS.MODAL, ONYXKEYS.NETWORK, ONYXKEYS.SESSION, @@ -219,11 +220,11 @@ function setSidebarLoaded() { return; } - Onyx.set(ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, true); + Onyx.set(ONYXKEYS.IS_SIDEBAR_LOADED, true); } function setAppLoading(isLoading: boolean) { - Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, isLoading); + Onyx.set(ONYXKEYS.IS_LOADING_APP, isLoading); } /** @@ -297,9 +298,9 @@ function getPolicyParamsForOpenOrReconnect(): Promise = { optimisticData: [ { onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, + key: ONYXKEYS.IS_LOADING_REPORT_DATA, value: true, }, ], @@ -339,7 +340,7 @@ function getOnyxDataForOpenOrReconnect( finallyData: [ { onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, + key: ONYXKEYS.IS_LOADING_REPORT_DATA, value: false, }, ], @@ -355,13 +356,13 @@ function getOnyxDataForOpenOrReconnect( if (isOpenApp) { result.optimisticData?.push({ onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + key: ONYXKEYS.IS_LOADING_APP, value: true, }); result.finallyData?.push({ onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + key: ONYXKEYS.IS_LOADING_APP, value: false, }); } @@ -423,7 +424,7 @@ function openApp(shouldKeepPublicRooms = false, allReportsWithDraftComments?: Re // Exception: When forceRun is true (exiting imported state), always make the API call if (isUsingImportedState && !forceRun) { Onyx.multiSet({ - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, [ONYXKEYS.HAS_LOADED_APP]: true, }); return Promise.resolve(); diff --git a/src/libs/actions/Card.ts b/src/libs/actions/Card.ts index 4288af0901fe..41ed86a7e876 100644 --- a/src/libs/actions/Card.ts +++ b/src/libs/actions/Card.ts @@ -745,7 +745,7 @@ function getCardDefaultName(userName?: string) { } function setIssueNewCardStepAndData({data, isEditing, step, policyID, isChangeAssigneeDisabled}: IssueNewCardFlowData) { - Onyx.merge(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, { + Onyx.merge(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, { data, isEditing, currentStep: step, @@ -761,7 +761,7 @@ function setDraftInviteAccountID(assigneeEmail: string | undefined, assigneeAcco } function clearIssueNewCardFlow(policyID: string | undefined) { - Onyx.set(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, { + Onyx.set(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, { currentStep: null, data: {}, isSuccessful: false, @@ -774,7 +774,7 @@ function clearIssueNewCardFormData() { } function clearIssueNewCardError(policyID: string | undefined) { - Onyx.merge(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, {errors: null}); + Onyx.merge(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, {errors: null}); } function buildCardListUpdates(workspaceAccountID: number, cardID: number, cardUpdateData: CardListUpdateData, shouldUpdateCardList: boolean): CardOnyxUpdate[] { @@ -1364,10 +1364,10 @@ function issueExpensifyCard( const {assigneeEmail, limit, limitType, cardTitle, cardType, validFrom, validThru} = data; - const optimisticData: Array> = [ + const optimisticData: Array> = [ { onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, + key: `${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, value: { isLoading: true, errors: null, @@ -1376,10 +1376,10 @@ function issueExpensifyCard( }, ]; - const successData: Array> = [ + const successData: Array> = [ { onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, + key: `${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, value: { isLoading: false, isSuccessful: true, @@ -1387,10 +1387,10 @@ function issueExpensifyCard( }, ]; - const failureData: Array> = [ + const failureData: Array> = [ { onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, + key: `${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, value: { isLoading: false, errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('common.genericErrorMessage'), diff --git a/src/libs/actions/Delegate.ts b/src/libs/actions/Delegate.ts index a31097d7e3a7..2c66412bc1fd 100644 --- a/src/libs/actions/Delegate.ts +++ b/src/libs/actions/Delegate.ts @@ -24,7 +24,7 @@ const KEYS_TO_PRESERVE_DELEGATE_ACCESS = [ ONYXKEYS.NVP_TRY_FOCUS_MODE, ONYXKEYS.PREFERRED_THEME, ONYXKEYS.NVP_PREFERRED_LOCALE, - ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, + ONYXKEYS.ARE_TRANSLATIONS_LOADING, ONYXKEYS.SESSION, ONYXKEYS.STASHED_SESSION, ONYXKEYS.HAS_LOADED_APP, @@ -33,7 +33,7 @@ const KEYS_TO_PRESERVE_DELEGATE_ACCESS = [ // We need to preserve the sidebar loaded state since we never unmount the sidebar when connecting as a delegate // This allows the report screen to load correctly when the delegate token expires and the delegate is returned to their original account. - ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, + ONYXKEYS.IS_SIDEBAR_LOADED, ONYXKEYS.NETWORK, ONYXKEYS.SHOULD_USE_STAGING_SERVER, ONYXKEYS.IS_DEBUG_MODE_ENABLED, diff --git a/src/libs/actions/MobileSelectionMode.ts b/src/libs/actions/MobileSelectionMode.ts index d21fdca0da8a..65c6e463461b 100644 --- a/src/libs/actions/MobileSelectionMode.ts +++ b/src/libs/actions/MobileSelectionMode.ts @@ -2,11 +2,11 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '@src/ONYXKEYS'; const turnOnMobileSelectionMode = () => { - Onyx.merge(ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE, true); + Onyx.merge(ONYXKEYS.MOBILE_SELECTION_MODE, true); }; const turnOffMobileSelectionMode = () => { - Onyx.merge(ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE, false); + Onyx.merge(ONYXKEYS.MOBILE_SELECTION_MODE, false); }; export {turnOnMobileSelectionMode, turnOffMobileSelectionMode}; diff --git a/src/libs/actions/OnyxDerived/index.ts b/src/libs/actions/OnyxDerived/index.ts index 57950c582d5f..ac245f116b1b 100644 --- a/src/libs/actions/OnyxDerived/index.ts +++ b/src/libs/actions/OnyxDerived/index.ts @@ -115,7 +115,8 @@ function init() { } else if (dependencyOnyxKey === ONYXKEYS.NVP_PREFERRED_LOCALE) { // Special case for locale, we want to recompute derived values when the locale change actually loads. Onyx.connectWithoutView({ - key: ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, + key: ONYXKEYS.ARE_TRANSLATIONS_LOADING, + initWithStoredValues: false, callback: (value) => { if (value ?? true) { Log.info(`[OnyxDerived] translations are still loading, not recomputing derived value for ${key}`); diff --git a/src/libs/actions/OnyxUpdateManager/index.ts b/src/libs/actions/OnyxUpdateManager/index.ts index cc8c299e13af..5561c6e1e175 100644 --- a/src/libs/actions/OnyxUpdateManager/index.ts +++ b/src/libs/actions/OnyxUpdateManager/index.ts @@ -46,7 +46,7 @@ let isLoadingApp = false; // `isLoadingApp` is not dependent on any changes on the UI, // so it is okay to use `connectWithoutView` here. Onyx.connectWithoutView({ - key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + key: ONYXKEYS.IS_LOADING_APP, callback: (value) => { isLoadingApp = value ?? false; }, diff --git a/src/libs/actions/QueuedOnyxUpdates.ts b/src/libs/actions/QueuedOnyxUpdates.ts index 9f673b38e566..be2a1480ccec 100644 --- a/src/libs/actions/QueuedOnyxUpdates.ts +++ b/src/libs/actions/QueuedOnyxUpdates.ts @@ -38,12 +38,12 @@ function flushQueue(): Promise { ONYXKEYS.NVP_TRY_FOCUS_MODE, ONYXKEYS.PREFERRED_THEME, ONYXKEYS.NVP_PREFERRED_LOCALE, - ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, + ONYXKEYS.ARE_TRANSLATIONS_LOADING, ONYXKEYS.SESSION, - ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + ONYXKEYS.IS_LOADING_APP, ONYXKEYS.HAS_LOADED_APP, ONYXKEYS.CREDENTIALS, - ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, + ONYXKEYS.IS_SIDEBAR_LOADED, ONYXKEYS.ACCOUNT, ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, ONYXKEYS.MODAL, diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts index f3ee54c24766..8219ff12743d 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -300,7 +300,7 @@ const KEYS_TO_PRESERVE_SUPPORTAL = [ ONYXKEYS.NVP_TRY_FOCUS_MODE, ONYXKEYS.PREFERRED_THEME, ONYXKEYS.NVP_PREFERRED_LOCALE, - ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, + ONYXKEYS.ARE_TRANSLATIONS_LOADING, ONYXKEYS.SESSION, ONYXKEYS.STASHED_SESSION, ONYXKEYS.HAS_LOADED_APP, @@ -309,7 +309,7 @@ const KEYS_TO_PRESERVE_SUPPORTAL = [ // We need to preserve the sidebar loaded state since we never unmount the sidebar when connecting as a delegate // This allows the report screen to load correctly when the delegate token expires and the delegate is returned to their original account. - ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, + ONYXKEYS.IS_SIDEBAR_LOADED, ONYXKEYS.NETWORK, ONYXKEYS.SHOULD_USE_STAGING_SERVER, ONYXKEYS.IS_DEBUG_MODE_ENABLED, diff --git a/src/libs/actions/SignInRedirect.ts b/src/libs/actions/SignInRedirect.ts index c07a8cbccbf5..8fcf14765ab0 100644 --- a/src/libs/actions/SignInRedirect.ts +++ b/src/libs/actions/SignInRedirect.ts @@ -50,7 +50,7 @@ function clearStorageAndRedirect(errorMessage?: string): Promise { // flashes of unwanted default state. const keysToPreserve: OnyxKey[] = []; keysToPreserve.push(ONYXKEYS.NVP_PREFERRED_LOCALE); - keysToPreserve.push(ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING); + keysToPreserve.push(ONYXKEYS.ARE_TRANSLATIONS_LOADING); keysToPreserve.push(ONYXKEYS.PREFERRED_THEME); keysToPreserve.push(ONYXKEYS.ACTIVE_CLIENTS); keysToPreserve.push(ONYXKEYS.DEVICE_ID); diff --git a/src/libs/actions/Wallet.ts b/src/libs/actions/Wallet.ts index f1d6aa424d44..27625e744cd6 100644 --- a/src/libs/actions/Wallet.ts +++ b/src/libs/actions/Wallet.ts @@ -206,27 +206,7 @@ function openInitialSettingsPage() { * Fetches data when the user opens the EnablePaymentsPage */ function openEnablePaymentsPage() { - const optimisticData: Array> = [ - { - onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.USER_WALLET, - value: { - isLoading: true, - }, - }, - ]; - - const finallyData: Array> = [ - { - onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.USER_WALLET, - value: { - isLoading: false, - }, - }, - ]; - - API.read(READ_COMMANDS.OPEN_ENABLE_PAYMENTS_PAGE, null, {optimisticData, finallyData}); + API.read(READ_COMMANDS.OPEN_ENABLE_PAYMENTS_PAGE, null); } function updateCurrentStep(currentStep: ValueOf | null) { diff --git a/src/libs/actions/Welcome/index.ts b/src/libs/actions/Welcome/index.ts index 2058af77ac1c..a10f96e62a8e 100644 --- a/src/libs/actions/Welcome/index.ts +++ b/src/libs/actions/Welcome/index.ts @@ -115,7 +115,8 @@ function completeHybridAppOnboarding() { // We use `connectWithoutView` here since this connection only to get loading flag // and doesn't need to trigger component re-renders. Onyx.connectWithoutView({ - key: ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, + key: ONYXKEYS.IS_LOADING_REPORT_DATA, + initWithStoredValues: false, callback: (value) => { isLoadingReportData = value ?? false; checkServerDataReady(); diff --git a/src/pages/ConciergePage.tsx b/src/pages/ConciergePage.tsx index 144e7bcf41dc..2b3a804391f5 100644 --- a/src/pages/ConciergePage.tsx +++ b/src/pages/ConciergePage.tsx @@ -24,7 +24,7 @@ function ConciergePage() { const styles = useThemeStyles(); const isUnmounted = useRef(false); const [session] = useOnyx(ONYXKEYS.SESSION); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [betas] = useOnyx(ONYXKEYS.BETAS); diff --git a/src/pages/EnablePayments/EnablePaymentsPage.tsx b/src/pages/EnablePayments/EnablePaymentsPage.tsx index af0c83086376..6968aa048569 100644 --- a/src/pages/EnablePayments/EnablePaymentsPage.tsx +++ b/src/pages/EnablePayments/EnablePaymentsPage.tsx @@ -1,4 +1,4 @@ -import React, {useEffect, useRef} from 'react'; +import React, {useEffect} from 'react'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import ScreenWrapper from '@components/ScreenWrapper'; @@ -22,44 +22,30 @@ import TermsStep from './TermsStep'; function EnablePaymentsPage() { const {translate} = useLocalize(); const {isOffline} = useNetwork(); - const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET); + const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET, { + // We want to refresh the wallet each time the user attempts to activate the wallet so we won't use the + // stored values here. + initWithStoredValues: false, + }); const {isPendingOnfidoResult, hasFailedOnfido} = userWallet ?? {}; - const wasLoadingRef = useRef(false); - // Always fetch fresh wallet data on mount useEffect(() => { if (isOffline) { return; } - openEnablePaymentsPage(); - }, [isOffline]); - - // Only redirect after the fresh data loading cycle (isLoading: true → false) completes, - // to avoid acting on stale cached values from a previous session. - useEffect(() => { - if (isOffline) { - return; - } - - if (userWallet?.isLoading) { - wasLoadingRef.current = true; - return; - } - - if (!wasLoadingRef.current) { - return; - } - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing if (isPendingOnfidoResult || hasFailedOnfido) { Navigation.navigate(ROUTES.SETTINGS_WALLET, {forceReplace: true}); + return; } - }, [isOffline, isPendingOnfidoResult, hasFailedOnfido, userWallet?.isLoading]); + + openEnablePaymentsPage(); + }, [isOffline, isPendingOnfidoResult, hasFailedOnfido]); const isUserWalletEmpty = isEmptyObject(userWallet); - if (isUserWalletEmpty || userWallet?.isLoading) { + if (isUserWalletEmpty) { const reasonAttributes: SkeletonSpanReasonAttributes = { context: 'EnablePaymentsPage', isUserWalletEmpty, diff --git a/src/pages/NewReportWorkspaceSelectionPage.tsx b/src/pages/NewReportWorkspaceSelectionPage.tsx index 91c00f750102..5812cb594d1a 100644 --- a/src/pages/NewReportWorkspaceSelectionPage.tsx +++ b/src/pages/NewReportWorkspaceSelectionPage.tsx @@ -77,7 +77,7 @@ function NewReportWorkspaceSelectionPage({route}: NewReportWorkspaceSelectionPag const [allTransactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION); const currentUserPersonalDetails = useCurrentUserPersonalDetails(); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const shouldShowLoadingIndicator = isLoadingApp && !isOffline; const [pendingPolicySelection, setPendingPolicySelection] = useState<{policy: WorkspaceListItem; shouldShowEmptyReportConfirmation: boolean} | null>(null); diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx b/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx index ae23e28ed5c8..5ce6d74e9545 100644 --- a/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx +++ b/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx @@ -84,7 +84,7 @@ function ReimbursementAccountPage({route, policy, isLoadingPolicy, navigation}: const [reimbursementAccountDraft] = useOnyx(ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM_DRAFT); const [plaidCurrentEvent = ''] = useOnyx(ONYXKEYS.PLAID_CURRENT_EVENT); const [onfidoToken = ''] = useOnyx(ONYXKEYS.ONFIDO_TOKEN); - const [isLoadingApp = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = false] = useOnyx(ONYXKEYS.IS_LOADING_APP); const topmostFullScreenRoute = useRootNavigationState((state) => state?.routes.findLast((lastRoute) => isFullScreenName(lastRoute.name))); const {isBetaEnabled} = usePermissions(); diff --git a/src/pages/ReportChangeWorkspacePage.tsx b/src/pages/ReportChangeWorkspacePage.tsx index b6610d3eefae..96fa4c97a99a 100644 --- a/src/pages/ReportChangeWorkspacePage.tsx +++ b/src/pages/ReportChangeWorkspacePage.tsx @@ -58,7 +58,7 @@ function ReportChangeWorkspacePage({report, route}: ReportChangeWorkspacePagePro const [policies, fetchStatus] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const [reportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${reportID}`); const [isChangePolicyTrainingModalDismissed = false] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING, {selector: changePolicyTrainingModalDismissedSelector}); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS); const isReportLastVisibleArchived = useReportIsArchived(report?.parentReportID); const reportOwnerAccountID = report?.ownerAccountID; diff --git a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWorkspacePage.tsx b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWorkspacePage.tsx index 5b5c99489de6..bdde4bd61b7d 100644 --- a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWorkspacePage.tsx +++ b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWorkspacePage.tsx @@ -35,7 +35,7 @@ function SearchFiltersWorkspacePage() { const [searchAdvancedFiltersForm] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM); const [policies, policiesResult] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const [currentUserLogin] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector}); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [searchTerm, debouncedSearchTerm, setSearchTerm] = useDebouncedState(''); const shouldShowLoadingIndicator = isLoadingApp && !isOffline; const selectionListRef = useRef>(null); diff --git a/src/pages/Search/SearchMoneyRequestReportPage.tsx b/src/pages/Search/SearchMoneyRequestReportPage.tsx index 6eab2fb51d7a..4d854cda03a3 100644 --- a/src/pages/Search/SearchMoneyRequestReportPage.tsx +++ b/src/pages/Search/SearchMoneyRequestReportPage.tsx @@ -138,7 +138,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { const [reportMetadata = defaultReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`); const [policies = getEmptyObject>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const policy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]; - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const isReportArchived = useReportIsArchived(report?.reportID); const {isEditingDisabled, isCurrentReportLoadedFromOnyx} = useIsReportReadyToDisplay(report, reportIDFromRoute, isReportArchived); diff --git a/src/pages/SetDefaultWorkspacePage.tsx b/src/pages/SetDefaultWorkspacePage.tsx index 263deba80010..b1c629c1639f 100644 --- a/src/pages/SetDefaultWorkspacePage.tsx +++ b/src/pages/SetDefaultWorkspacePage.tsx @@ -31,7 +31,7 @@ function SetDefaultWorkspacePage({route}: SetDefaultWorkspacePageProps) { const {translate, localeCompare} = useLocalize(); const [policies, fetchStatus] = useOnyx(ONYXKEYS.COLLECTION.POLICY); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); const shouldShowLoadingIndicator = isLoadingApp && !isOffline; diff --git a/src/pages/ValidateLoginPage/index.website.tsx b/src/pages/ValidateLoginPage/index.website.tsx index 3081b9ed9744..4fe5ad2a7ca1 100644 --- a/src/pages/ValidateLoginPage/index.website.tsx +++ b/src/pages/ValidateLoginPage/index.website.tsx @@ -1,4 +1,4 @@ -import React, {useEffect, useState} from 'react'; +import React, {useEffect} from 'react'; import type {OnyxEntry} from 'react-native-onyx'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import ExpiredValidateCodeModal from '@components/ValidateCode/ExpiredValidateCodeModal'; @@ -26,13 +26,10 @@ function ValidateLoginPage({ const login = credentials?.login; const isSignedIn = !!session?.authToken && session?.authTokenType !== CONST.AUTH_TOKEN_TYPES.ANONYMOUS; - // When not signed in, ignore stored autoAuthState on the first render to prevent stale values - // (e.g. FAILED from a previous magic link attempt) from briefly rendering incorrect UI. - // Once initAutoAuthState() runs in the useEffect, the state is set to true and real values are used. - const [hasInitialized, setHasInitialized] = useState(isSignedIn); - const [autoAuthState] = useOnyx(ONYXKEYS.SESSION, {selector: autoAuthStateSelector}); - const effectiveAutoAuthState = hasInitialized ? autoAuthState : undefined; - const autoAuthStateWithDefault = effectiveAutoAuthState ?? CONST.AUTO_AUTH_STATE.NOT_STARTED; + // To ensure that the previous autoAuthState does not impact the rendering of the current magic link page, the autoAuthState prop sets initWithStoredValues to false. + // This is done unless the user is signed in, in which case the page will be remounted upon successful sign-in, as explained in Session.initAutoAuthState. + const [autoAuthState] = useOnyx(ONYXKEYS.SESSION, {initWithStoredValues: isSignedIn, selector: autoAuthStateSelector}); + const autoAuthStateWithDefault = autoAuthState ?? CONST.AUTO_AUTH_STATE.NOT_STARTED; const is2FARequired = !!account?.requiresTwoFactorAuth; const cachedAccountID = credentials?.accountID; const isUserClickedSignIn = !login && isSignedIn && (autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.SIGNING_IN || autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN); @@ -41,8 +38,6 @@ function ValidateLoginPage({ const [preferredLocale] = useOnyx(ONYXKEYS.NVP_PREFERRED_LOCALE); useEffect(() => { - setHasInitialized(true); - if (isUserClickedSignIn) { // The user clicked the option to sign in the current tab Navigation.isNavigationReady().then(() => { @@ -87,13 +82,13 @@ function ValidateLoginPage({ )} {autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN && isSignedIn && !exitTo && !!login && } {/* If session.autoAuthState isn't available yet, we use shouldStartSignInWithValidateCode to conditionally render the component instead of local autoAuthState which contains a default value of NOT_STARTED */} - {(!effectiveAutoAuthState ? !shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.NOT_STARTED && !isNavigatingToExitTo) && ( + {(!autoAuthState ? !shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.NOT_STARTED && !isNavigatingToExitTo) && ( )} - {(!effectiveAutoAuthState ? shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.SIGNING_IN) && ( + {(!autoAuthState ? shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.SIGNING_IN) && ( (null); diff --git a/src/pages/inbox/ReportFetchHandler.tsx b/src/pages/inbox/ReportFetchHandler.tsx index fa316de5a35d..c15aa9a2e6bf 100644 --- a/src/pages/inbox/ReportFetchHandler.tsx +++ b/src/pages/inbox/ReportFetchHandler.tsx @@ -74,8 +74,8 @@ function ReportFetchHandler() { const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [betas] = useOnyx(ONYXKEYS.BETAS); const [onboarding] = useOnyx(ONYXKEYS.NVP_ONBOARDING); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const prevIsLoadingReportData = usePrevious(isLoadingReportData); const reportID = reportOnyx?.reportID; diff --git a/src/pages/inbox/ReportNotFoundGuard.tsx b/src/pages/inbox/ReportNotFoundGuard.tsx index b8753ab8b0ac..c5ce99b3becf 100644 --- a/src/pages/inbox/ReportNotFoundGuard.tsx +++ b/src/pages/inbox/ReportNotFoundGuard.tsx @@ -36,8 +36,8 @@ function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { const [isLoadingInitialReportActions = true] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`, { selector: isLoadingInitialReportActionsSelector, }); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [deleteTransactionNavigateBackUrl] = useOnyx(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL); const parentReportAction = useParentReportAction(report); diff --git a/src/pages/inbox/report/ReportActionsView.tsx b/src/pages/inbox/report/ReportActionsView.tsx index c85c87e3f7c3..96764eecc23d 100755 --- a/src/pages/inbox/report/ReportActionsView.tsx +++ b/src/pages/inbox/report/ReportActionsView.tsx @@ -139,7 +139,7 @@ function ReportActionsView({reportID, onLayout}: ReportActionsViewProps) { [getTransactionThreadReportActions], ); const [transactionThreadReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID}`); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [visibleReportActionsData] = useOnyx(ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS); const prevTransactionThreadReport = usePrevious(transactionThreadReport); const prevReportActionID = usePrevious(reportActionID); diff --git a/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx b/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx index 485f94b7d6e7..512f85882ed9 100644 --- a/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx +++ b/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx @@ -43,7 +43,7 @@ export default function { if (value !== false) { return; @@ -38,7 +38,7 @@ function BaseSidebarScreen() { const {shouldUseNarrowLayout} = useResponsiveLayout(); const shouldDisplayLHB = !shouldUseNarrowLayout; - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const shouldShowSkeleton = isLoadingApp && !hasEverFinishedLoading; // Must be called unconditionally so openApp() can proceed even when diff --git a/src/pages/inbox/sidebar/FABPopoverContent/menuItems/NewWorkspaceMenuItem.tsx b/src/pages/inbox/sidebar/FABPopoverContent/menuItems/NewWorkspaceMenuItem.tsx index f796a132bf5f..4d660811e6b1 100644 --- a/src/pages/inbox/sidebar/FABPopoverContent/menuItems/NewWorkspaceMenuItem.tsx +++ b/src/pages/inbox/sidebar/FABPopoverContent/menuItems/NewWorkspaceMenuItem.tsx @@ -27,7 +27,7 @@ function NewWorkspaceMenuItem() { const {shouldUseNarrowLayout} = useResponsiveLayout(); const icons = useMemoizedLazyExpensifyIcons(['NewWorkspace']); const {isOffline} = useNetwork(); - const [isLoading = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoading = false] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [sessionEmail] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector}); const [allPolicies] = useMappedPolicies(policyMapper); const {isRestrictedPolicyCreation} = usePreferredPolicy(); diff --git a/src/pages/inbox/sidebar/ProfileAvatarWithIndicator.tsx b/src/pages/inbox/sidebar/ProfileAvatarWithIndicator.tsx index 799dd44218b9..ef3f2e6e0950 100644 --- a/src/pages/inbox/sidebar/ProfileAvatarWithIndicator.tsx +++ b/src/pages/inbox/sidebar/ProfileAvatarWithIndicator.tsx @@ -20,7 +20,7 @@ type ProfileAvatarWithIndicatorProps = { function ProfileAvatarWithIndicator({isSelected = false, containerStyles}: ProfileAvatarWithIndicatorProps) { const styles = useThemeStyles(); const currentUserPersonalDetails = useCurrentUserPersonalDetails(); - const [isLoading = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoading = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); return ( { ReportActionContextMenu.hideContextMenu(false); diff --git a/src/pages/iou/request/step/withWritableReportOrNotFound.tsx b/src/pages/iou/request/step/withWritableReportOrNotFound.tsx index 8dfeb62864b5..3fd755feb219 100644 --- a/src/pages/iou/request/step/withWritableReportOrNotFound.tsx +++ b/src/pages/iou/request/step/withWritableReportOrNotFound.tsx @@ -71,7 +71,7 @@ export default function ) { const {route} = props; const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [reportDraft] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_DRAFT}${route.params.reportID}`); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [betas] = useOnyx(ONYXKEYS.BETAS); diff --git a/src/pages/media/AttachmentModalScreen/routes/ProfileAvatarModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/ProfileAvatarModalContent.tsx index 1555c1029877..9a79deeb7c8f 100644 --- a/src/pages/media/AttachmentModalScreen/routes/ProfileAvatarModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/ProfileAvatarModalContent.tsx @@ -26,7 +26,7 @@ function ProfileAvatarModalContent({navigation, route}: AttachmentModalScreenPro const avatarURL = personalDetail?.avatar ?? ''; const displayName = getDisplayNameOrDefault(personalDetail); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const isLoading = personalDetailsMetadata?.[accountID]?.isLoading ?? (isLoadingApp && !Object.keys(personalDetail ?? {}).length); useEffect(() => { diff --git a/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx index ae798e0c5f8f..70fa08ede752 100644 --- a/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx @@ -16,7 +16,7 @@ function WorkspaceAvatarModalContent({navigation, route}: AttachmentModalScreenP const defaultAvatars = useDefaultAvatars(); const policy = usePolicy(policyID); - const [isLoadingApp = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = false] = useOnyx(ONYXKEYS.IS_LOADING_APP, {initWithStoredValues: false}); const avatarURL = policy?.avatarURL ?? getDefaultWorkspaceAvatar(policy?.name ?? fallbackLetter); const source = getFullSizeAvatar({avatarSource: avatarURL, defaultAvatars}); diff --git a/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx b/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx index 46a64206c4b1..31606deb2f2e 100644 --- a/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx @@ -47,7 +47,7 @@ function ReportAddAttachmentModalContent({route, navigation}: AttachmentModalScr const [betas] = useOnyx(ONYXKEYS.BETAS); const isReportArchived = useReportIsArchived(reportID); const canPerformWriteAction = canUserPerformWriteAction(report, isReportArchived); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const {isOffline} = useNetwork(); const submitRef = useRef(null); diff --git a/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx index 7c5cb427faf3..75600ef3b2b7 100644 --- a/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx @@ -52,7 +52,7 @@ function ReportAttachmentModalContent({route, navigation}: AttachmentModalScreen useNavigateToReportOnRefresh({source: sourceParam, reportID}); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const {isOffline} = useNetwork(); const submitRef = useRef(null); diff --git a/src/pages/media/AttachmentModalScreen/routes/report/ReportAvatarModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/report/ReportAvatarModalContent.tsx index 783672cea989..e64858cd7901 100644 --- a/src/pages/media/AttachmentModalScreen/routes/report/ReportAvatarModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/report/ReportAvatarModalContent.tsx @@ -18,7 +18,7 @@ function ReportAvatarModalContent({navigation, route}: AttachmentModalScreenProp const defaultAvatars = useDefaultAvatars(); const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`); const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const reportAttributes = useReportAttributes(); const attachment: AttachmentModalBaseContentProps = useMemo(() => { diff --git a/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx b/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx index 3a6d475e2d83..b7aaedcf1d21 100644 --- a/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx +++ b/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx @@ -58,7 +58,7 @@ function ContactMethodDetailsPage({route}: ContactMethodDetailsPageProps) { const [session, sessionResult] = useOnyx(ONYXKEYS.SESSION); const [myDomainSecurityGroups, myDomainSecurityGroupsResult] = useOnyx(ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS); const [securityGroups, securityGroupsResult] = useOnyx(ONYXKEYS.COLLECTION.SECURITY_GROUP); - const [isLoadingReportData = true, isLoadingReportDataResult] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true, isLoadingReportDataResult] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const [isValidateCodeFormVisible, setIsValidateCodeFormVisible] = useState(true); const {isActingAsDelegate} = useDelegateNoAccessState(); diff --git a/src/pages/settings/Profile/DisplayNamePage.tsx b/src/pages/settings/Profile/DisplayNamePage.tsx index d8ce05d703eb..6e91420ba2a1 100644 --- a/src/pages/settings/Profile/DisplayNamePage.tsx +++ b/src/pages/settings/Profile/DisplayNamePage.tsx @@ -41,7 +41,7 @@ const updateDisplayName = ( function DisplayNamePage({currentUserPersonalDetails}: DisplayNamePageProps) { const styles = useThemeStyles(); const {translate, formatPhoneNumber} = useLocalize(); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const currentUserDetails = currentUserPersonalDetails ?? {}; diff --git a/src/pages/settings/Profile/PersonalDetails/BaseLegalNamePage.tsx b/src/pages/settings/Profile/PersonalDetails/BaseLegalNamePage.tsx index 444db737eaeb..c5ac59d1cd3f 100644 --- a/src/pages/settings/Profile/PersonalDetails/BaseLegalNamePage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/BaseLegalNamePage.tsx @@ -90,7 +90,7 @@ function BaseLegalNamePage({ defaultLastName, }: BaseLegalNamePageProps) { const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const styles = useThemeStyles(); const {translate} = useLocalize(); diff --git a/src/pages/settings/Profile/PersonalDetails/DateOfBirthPage.tsx b/src/pages/settings/Profile/PersonalDetails/DateOfBirthPage.tsx index bd8ce9a8d463..12c35854a51b 100644 --- a/src/pages/settings/Profile/PersonalDetails/DateOfBirthPage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/DateOfBirthPage.tsx @@ -21,7 +21,7 @@ import INPUT_IDS from '@src/types/form/DateOfBirthForm'; function DateOfBirthPage() { const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const {translate} = useLocalize(); const styles = useThemeStyles(); diff --git a/src/pages/settings/Profile/PersonalDetails/PersonalAddressPage.tsx b/src/pages/settings/Profile/PersonalDetails/PersonalAddressPage.tsx index e677cc4587b9..7f553e3c3d5b 100644 --- a/src/pages/settings/Profile/PersonalDetails/PersonalAddressPage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/PersonalAddressPage.tsx @@ -32,7 +32,7 @@ function updateAddress(values: FormOnyxValues normalizeCountryCode(getCurrentAddress(privatePersonalDetails)) as Address, [privatePersonalDetails]); diff --git a/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx b/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx index 8fd4033dfc66..46b6f49a7415 100644 --- a/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx @@ -26,7 +26,7 @@ import type {PrivatePersonalDetails} from '@src/types/onyx'; function PhoneNumberPage() { const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE); const styles = useThemeStyles(); const {translate} = useLocalize(); diff --git a/src/pages/settings/Profile/ProfilePage.tsx b/src/pages/settings/Profile/ProfilePage.tsx index f2ec7300f197..502bc6f6fecf 100755 --- a/src/pages/settings/Profile/ProfilePage.tsx +++ b/src/pages/settings/Profile/ProfilePage.tsx @@ -52,7 +52,7 @@ function ProfilePage() { const currentUserPersonalDetails = useCurrentUserPersonalDetails(); const route = useRoute>(); useDocumentTitle(translate('common.profile')); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const getPronouns = (): string => { const pronounsKey = currentUserPersonalDetails?.pronouns?.replace(CONST.PRONOUNS.PREFIX, '') ?? ''; return pronounsKey ? translate(`pronouns.${pronounsKey}` as TranslationPaths) : translate('profilePage.selectYourPronouns'); diff --git a/src/pages/settings/Profile/PronounsPage.tsx b/src/pages/settings/Profile/PronounsPage.tsx index db79dd611a7b..17201155ca70 100644 --- a/src/pages/settings/Profile/PronounsPage.tsx +++ b/src/pages/settings/Profile/PronounsPage.tsx @@ -26,7 +26,7 @@ type PronounsPageProps = WithCurrentUserPersonalDetailsProps; function PronounsPage({currentUserPersonalDetails}: PronounsPageProps) { const styles = useThemeStyles(); const {translate, localeCompare} = useLocalize(); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const currentPronouns = currentUserPersonalDetails?.pronouns ?? ''; const currentPronounsKey = currentPronouns.substring(CONST.PRONOUNS.PREFIX.length); const [searchValue, setSearchValue] = useState(''); diff --git a/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx b/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx index 3896324336ef..5693bbc6871b 100644 --- a/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx +++ b/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx @@ -34,7 +34,7 @@ function SubscriptionSettingsPage({route}: SubscriptionSettingsPageProps) { useEffect(() => { openSubscriptionPage(); }, []); - const [isAppLoading = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isAppLoading = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [amountOwed] = useOnyx(ONYXKEYS.NVP_PRIVATE_AMOUNT_OWED); const shouldShowPage = !!subscriptionPlan || (amountOwed ?? 0) > 0; diff --git a/src/pages/settings/Wallet/WalletPage/index.tsx b/src/pages/settings/Wallet/WalletPage/index.tsx index de4b8a179bd0..7bc6c3ca54ba 100644 --- a/src/pages/settings/Wallet/WalletPage/index.tsx +++ b/src/pages/settings/Wallet/WalletPage/index.tsx @@ -77,7 +77,7 @@ function WalletPage() { const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET); const [countryByIp] = useOnyx(ONYXKEYS.COUNTRY); const [walletTerms = getEmptyObject()] = useOnyx(ONYXKEYS.WALLET_TERMS); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [userAccount] = useOnyx(ONYXKEYS.ACCOUNT); const [lastUsedPaymentMethods] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD); const [personalPolicyID] = useOnyx(ONYXKEYS.PERSONAL_POLICY_ID); diff --git a/src/pages/workspace/AccessOrNotFoundWrapper.tsx b/src/pages/workspace/AccessOrNotFoundWrapper.tsx index 278ddeef6377..2a38f0a58292 100644 --- a/src/pages/workspace/AccessOrNotFoundWrapper.tsx +++ b/src/pages/workspace/AccessOrNotFoundWrapper.tsx @@ -144,7 +144,7 @@ function AccessOrNotFoundWrapper({ }: AccessOrNotFoundWrapperProps) { const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`); const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const {login = ''} = useCurrentUserPersonalDetails(); const {isRestrictedToPreferredPolicy} = usePreferredPolicy(); const [betas] = useOnyx(ONYXKEYS.BETAS); diff --git a/src/pages/workspace/WorkspacesListPage.tsx b/src/pages/workspace/WorkspacesListPage.tsx index 1017d1090749..bad00af642fd 100755 --- a/src/pages/workspace/WorkspacesListPage.tsx +++ b/src/pages/workspace/WorkspacesListPage.tsx @@ -146,7 +146,7 @@ function WorkspacesListPage() { const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT); const [session] = useOnyx(ONYXKEYS.SESSION); const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [lastPaymentMethod] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD); const shouldShowLoadingIndicator = isLoadingApp && !isOffline; const route = useRoute>(); diff --git a/src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx b/src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx index 8b7e055d005c..815e4e82228b 100644 --- a/src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx @@ -47,7 +47,7 @@ function AssigneeStep({policy, stepNames, startStepIndex, route}: AssigneeStepPr const icons = useMemoizedLazyExpensifyIcons(['FallbackAvatar']); const {isOffline} = useNetwork(); const policyID = route.params.policyID; - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); const [account] = useOnyx(ONYXKEYS.ACCOUNT); const [didScreenTransitionEnd, setDidScreenTransitionEnd] = useState(false); diff --git a/src/pages/workspace/expensifyCard/issueNew/CardNameStep.tsx b/src/pages/workspace/expensifyCard/issueNew/CardNameStep.tsx index 07ce73efac1b..0848e753f410 100644 --- a/src/pages/workspace/expensifyCard/issueNew/CardNameStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/CardNameStep.tsx @@ -34,7 +34,7 @@ function CardNameStep({policyID, stepNames, startStepIndex}: CardNameStepProps) const {translate} = useLocalize(); const styles = useThemeStyles(); const {inputCallbackRef} = useAutoFocusInput(); - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const isEditing = issueNewCard?.isEditing; const data = issueNewCard?.data; diff --git a/src/pages/workspace/expensifyCard/issueNew/CardTypeStep.tsx b/src/pages/workspace/expensifyCard/issueNew/CardTypeStep.tsx index 72675705449e..c88c6844a3a9 100644 --- a/src/pages/workspace/expensifyCard/issueNew/CardTypeStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/CardTypeStep.tsx @@ -33,7 +33,7 @@ function CardTypeStep({policy, stepNames, startStepIndex}: CardTypeStepProps) { const styles = useThemeStyles(); const illustrations = useMemoizedLazyIllustrations(['HandCard', 'VirtualCard']); const policyID = policy?.id; - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const isEditing = issueNewCard?.isEditing; diff --git a/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx b/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx index 5a6c1516abd1..1a9de688ff4a 100644 --- a/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx @@ -45,7 +45,7 @@ function ConfirmationStep({policyID, stepNames, startStepIndex, backTo}: Confirm const styles = useThemeStyles(); const {isOffline} = useNetwork(); const [account] = useOnyx(ONYXKEYS.ACCOUNT); - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); const defaultFundID = useDefaultFundID(policyID); const {isBetaEnabled} = usePermissions(); diff --git a/src/pages/workspace/expensifyCard/issueNew/InviteNewMemberStep.tsx b/src/pages/workspace/expensifyCard/issueNew/InviteNewMemberStep.tsx index 813fa306e413..16aaa18f6caa 100644 --- a/src/pages/workspace/expensifyCard/issueNew/InviteNewMemberStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/InviteNewMemberStep.tsx @@ -22,7 +22,7 @@ type InviteeNewMemberStepProps = Omit { diff --git a/src/pages/workspace/expensifyCard/issueNew/IssueNewCardConfirmMagicCodePage.tsx b/src/pages/workspace/expensifyCard/issueNew/IssueNewCardConfirmMagicCodePage.tsx index 242fc4626e02..b2c2e01fe5d9 100644 --- a/src/pages/workspace/expensifyCard/issueNew/IssueNewCardConfirmMagicCodePage.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/IssueNewCardConfirmMagicCodePage.tsx @@ -26,7 +26,7 @@ function IssueNewCardConfirmMagicCodePage({route}: IssueNewCardConfirmMagicCodeP const [account] = useOnyx(ONYXKEYS.ACCOUNT); const [session] = useOnyx(ONYXKEYS.SESSION); const primaryLogin = account?.primaryLogin ?? session?.email ?? ''; - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const validateError = getLatestErrorMessageField(issueNewCard); const data = issueNewCard?.data; const isSuccessful = issueNewCard?.isSuccessful; diff --git a/src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx b/src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx index cc39f988df40..ac6bd562bfbe 100644 --- a/src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx @@ -46,7 +46,7 @@ function getStartStepIndex(issueNewCard: OnyxEntry): number { function IssueNewCardPage({policy, route}: IssueNewCardPageProps) { const policyID = policy?.id; - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, {initWithStoredValues: false}); const {currentStep} = issueNewCard ?? {}; const backTo = route?.params?.backTo; const {isDelegateAccessRestricted} = useDelegateNoAccessState(); diff --git a/src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx b/src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx index 6e634ee2a96c..941339de9921 100644 --- a/src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx @@ -38,7 +38,7 @@ function LimitTypeStep({policy, stepNames, startStepIndex}: LimitTypeStepProps) const {translate} = useLocalize(); const styles = useThemeStyles(); const policyID = policy?.id; - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const formRef = useRef(null); const areApprovalsConfigured = getApprovalWorkflow(policy) !== CONST.POLICY.APPROVAL_MODE.OPTIONAL; diff --git a/src/pages/workspace/expensifyCard/issueNew/SetExpiryOptionsStep.tsx b/src/pages/workspace/expensifyCard/issueNew/SetExpiryOptionsStep.tsx index 1b49efb79427..78ad0e1bd6f6 100644 --- a/src/pages/workspace/expensifyCard/issueNew/SetExpiryOptionsStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/SetExpiryOptionsStep.tsx @@ -33,7 +33,7 @@ function SetExpiryOptionsStep({policy, stepNames, startStepIndex}: SetExpiryOpti const {translate} = useLocalize(); const styles = useThemeStyles(); const policyID = policy?.id; - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const personalDetails = usePersonalDetails(); const assigneePersonalDetails = Object.values(personalDetails ?? {}).find((detail) => detail?.login === issueNewCard?.data?.assigneeEmail); diff --git a/src/pages/workspace/withPolicyAndFullscreenLoading.tsx b/src/pages/workspace/withPolicyAndFullscreenLoading.tsx index b7dbb5b7a9c0..83e6399910cc 100644 --- a/src/pages/workspace/withPolicyAndFullscreenLoading.tsx +++ b/src/pages/workspace/withPolicyAndFullscreenLoading.tsx @@ -33,7 +33,7 @@ export default function withPolicyAndFullscreenLoading) { - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); if ((isLoadingPolicy || isLoadingReportData) && isEmpty(policy) && isEmpty(policyDraft)) { diff --git a/src/setup/index.ts b/src/setup/index.ts index 3ca084804264..0daed09b2bcb 100644 --- a/src/setup/index.ts +++ b/src/setup/index.ts @@ -48,7 +48,7 @@ export default function () { [ONYXKEYS.SESSION]: {loading: false}, [ONYXKEYS.ACCOUNT]: CONST.DEFAULT_ACCOUNT_DATA, [ONYXKEYS.NETWORK]: CONST.DEFAULT_NETWORK_DATA, - [ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED]: false, + [ONYXKEYS.IS_SIDEBAR_LOADED]: false, [ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: true, [ONYXKEYS.MODAL]: { isVisible: false, @@ -61,12 +61,6 @@ export default function () { skippableCollectionMemberIDs: CONST.SKIPPABLE_COLLECTION_MEMBER_IDS, snapshotMergeKeys: ['pendingAction', 'pendingFields'], ramOnlyKeys: [ - ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, - ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE, - ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, - ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, - ONYXKEYS.RAM_ONLY_IS_LOADING_APP, - ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD, ONYXKEYS.DERIVED.RAM_ONLY_SORTED_REPORT_ACTIONS, ONYXKEYS.RAM_ONLY_UPDATE_AVAILABLE, ONYXKEYS.RAM_ONLY_UPDATE_REQUIRED, diff --git a/src/types/onyx/UserWallet.ts b/src/types/onyx/UserWallet.ts index c67e5b529c37..eb1b11c7adb0 100644 --- a/src/types/onyx/UserWallet.ts +++ b/src/types/onyx/UserWallet.ts @@ -63,9 +63,6 @@ type UserWallet = { /** The type of setup for adding the bank account */ setupType?: SetupType; - - /** Whether the wallet data is currently being loaded from the server */ - isLoading?: boolean; }; export default UserWallet; diff --git a/tests/actions/QueuedOnyxUpdatesTest.ts b/tests/actions/QueuedOnyxUpdatesTest.ts index b4b3614f9469..d9959d31f6d4 100644 --- a/tests/actions/QueuedOnyxUpdatesTest.ts +++ b/tests/actions/QueuedOnyxUpdatesTest.ts @@ -11,9 +11,9 @@ const queuedOnyxUpdates: Array< | typeof ONYXKEYS.PREFERRED_THEME | typeof ONYXKEYS.NVP_PREFERRED_LOCALE | typeof ONYXKEYS.SESSION - | typeof ONYXKEYS.RAM_ONLY_IS_LOADING_APP + | typeof ONYXKEYS.IS_LOADING_APP | typeof ONYXKEYS.CREDENTIALS - | typeof ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED + | typeof ONYXKEYS.IS_SIDEBAR_LOADED | typeof ONYXKEYS.COLLECTION.REPORT | typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS > @@ -32,7 +32,7 @@ const queuedOnyxUpdates: Array< }, onyxMethod: 'merge', }, - {key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, value: false, onyxMethod: 'merge'}, + {key: ONYXKEYS.IS_LOADING_APP, value: false, onyxMethod: 'merge'}, { key: ONYXKEYS.CREDENTIALS, value: { @@ -42,7 +42,7 @@ const queuedOnyxUpdates: Array< }, onyxMethod: 'merge', }, - {key: ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, value: true, onyxMethod: 'merge'}, + {key: ONYXKEYS.IS_SIDEBAR_LOADED, value: true, onyxMethod: 'merge'}, {key: `${ONYXKEYS.COLLECTION.REPORT}2175919089355165`, value: {reportID: 'reportID'}, onyxMethod: 'merge'}, { key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}2175919089355165`, @@ -104,9 +104,9 @@ describe('actions/QueuedOnyxUpdates', () => { await testOnyxKeyValue(ONYXKEYS.PREFERRED_THEME); await testOnyxKeyValue(ONYXKEYS.NVP_PREFERRED_LOCALE); await testOnyxKeyValue(ONYXKEYS.SESSION); - await testOnyxKeyValue(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + await testOnyxKeyValue(ONYXKEYS.IS_LOADING_APP); await testOnyxKeyValue(ONYXKEYS.CREDENTIALS); - await testOnyxKeyValue(ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED); + await testOnyxKeyValue(ONYXKEYS.IS_SIDEBAR_LOADED); await new Promise((resolve) => { const connection = Onyx.connect({ @@ -149,9 +149,9 @@ describe('actions/QueuedOnyxUpdates', () => { await testOnyxKeyValue(ONYXKEYS.PREFERRED_THEME); await testOnyxKeyValue(ONYXKEYS.NVP_PREFERRED_LOCALE); await testOnyxKeyValue(ONYXKEYS.SESSION); - await testOnyxKeyValue(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + await testOnyxKeyValue(ONYXKEYS.IS_LOADING_APP); await testOnyxKeyValue(ONYXKEYS.CREDENTIALS); - await testOnyxKeyValue(ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED); + await testOnyxKeyValue(ONYXKEYS.IS_SIDEBAR_LOADED); await new Promise((resolve) => { const connection = Onyx.connect({ diff --git a/tests/actions/ReportTest.ts b/tests/actions/ReportTest.ts index 93cbba991184..6c8021f222db 100644 --- a/tests/actions/ReportTest.ts +++ b/tests/actions/ReportTest.ts @@ -3984,7 +3984,7 @@ describe('actions/Report', () => { it('should handle undefined conciergeReportID gracefully', async () => { // Don't set CONCIERGE_REPORT_ID to simulate undefined state - await Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); + await Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false); await waitForBatchedUpdates(); // When conciergeReportID is undefined, the function uses onServerDataReady() @@ -4113,7 +4113,7 @@ describe('actions/Report', () => { }); it('should not throw with any isSelfTourViewed value when conciergeReportID is undefined', async () => { - await Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); + await Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false); await waitForBatchedUpdates(); expect(() => { @@ -4247,7 +4247,7 @@ describe('actions/Report', () => { }); it('should handle undefined conciergeReportID by using fallback navigation', async () => { - await Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); + await Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false); await waitForBatchedUpdates(); expect(() => { diff --git a/tests/perf-test/SidebarLinks.perf-test.tsx b/tests/perf-test/SidebarLinks.perf-test.tsx index e8ce7d087c6b..0be24cc82032 100644 --- a/tests/perf-test/SidebarLinks.perf-test.tsx +++ b/tests/perf-test/SidebarLinks.perf-test.tsx @@ -80,7 +80,7 @@ describe('SidebarLinks', () => { [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, [ONYXKEYS.BETAS]: [CONST.BETAS.DEFAULT_ROOMS], [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, - [ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA]: false, + [ONYXKEYS.IS_LOADING_REPORT_DATA]: false, ...mockedResponseMap, }); @@ -102,7 +102,7 @@ describe('SidebarLinks', () => { [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, [ONYXKEYS.BETAS]: [CONST.BETAS.DEFAULT_ROOMS], [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, - [ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA]: false, + [ONYXKEYS.IS_LOADING_REPORT_DATA]: false, ...mockedResponseMap, }); diff --git a/tests/ui/AddressPageTest.tsx b/tests/ui/AddressPageTest.tsx index c0287eb9217b..93e65889bef9 100644 --- a/tests/ui/AddressPageTest.tsx +++ b/tests/ui/AddressPageTest.tsx @@ -66,7 +66,7 @@ describe('AddressPageTest', () => { }, ], }); - await Onyx.merge(`${ONYXKEYS.RAM_ONLY_IS_LOADING_APP}`, false); + await Onyx.merge(`${ONYXKEYS.IS_LOADING_APP}`, false); }); await waitForBatchedUpdatesWithAct(); @@ -96,7 +96,7 @@ describe('AddressPageTest', () => { }, ], }); - await Onyx.merge(`${ONYXKEYS.RAM_ONLY_IS_LOADING_APP}`, false); + await Onyx.merge(`${ONYXKEYS.IS_LOADING_APP}`, false); }); await waitForBatchedUpdatesWithAct(); @@ -118,7 +118,7 @@ describe('AddressPageTest', () => { }, ], }); - await Onyx.merge(`${ONYXKEYS.RAM_ONLY_IS_LOADING_APP}`, false); + await Onyx.merge(`${ONYXKEYS.IS_LOADING_APP}`, false); }); await waitForBatchedUpdatesWithAct(); diff --git a/tests/ui/AuthScreensInitHandlerTest.tsx b/tests/ui/AuthScreensInitHandlerTest.tsx index fe9b56b37387..9d9197186927 100644 --- a/tests/ui/AuthScreensInitHandlerTest.tsx +++ b/tests/ui/AuthScreensInitHandlerTest.tsx @@ -221,7 +221,7 @@ describe('AuthScreensInitHandler', () => { it('calls handleNetworkReconnect with openApp when isLoadingApp is true', async () => { await Onyx.merge(ONYXKEYS.SESSION, {accountID: TEST_ACCOUNT_ID, email: 'test@test.com'}); - await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, true); + await Onyx.merge(ONYXKEYS.IS_LOADING_APP, true); await waitForBatchedUpdates(); renderAuthScreensInitHandler(); @@ -238,7 +238,7 @@ describe('AuthScreensInitHandler', () => { it('calls handleNetworkReconnect with reconnectApp when isLoadingApp is false', async () => { await Onyx.merge(ONYXKEYS.SESSION, {accountID: TEST_ACCOUNT_ID, email: 'test@test.com'}); - await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); await waitForBatchedUpdates(); renderAuthScreensInitHandler(); diff --git a/tests/ui/ForYouSectionTest.tsx b/tests/ui/ForYouSectionTest.tsx index 07360d9eb46d..a1c3c80d2a59 100644 --- a/tests/ui/ForYouSectionTest.tsx +++ b/tests/ui/ForYouSectionTest.tsx @@ -104,7 +104,7 @@ describe('ForYouSection', () => { await act(async () => { await Onyx.multiSet({ [ONYXKEYS.SESSION]: {accountID: ACCOUNT_ID, email: 'test@example.com'}, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, }); }); await waitForBatchedUpdatesWithAct(); diff --git a/tests/ui/GroupChatNameTests.tsx b/tests/ui/GroupChatNameTests.tsx index 220666d79be2..7bd69524916e 100644 --- a/tests/ui/GroupChatNameTests.tsx +++ b/tests/ui/GroupChatNameTests.tsx @@ -198,7 +198,7 @@ function signInAndGetApp(reportName = '', participantAccountIDs?: number[]): Pro // Simulate setting an unread report and personal details await act(async () => { await Promise.all([ - Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false), + Onyx.merge(ONYXKEYS.IS_LOADING_APP, false), Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, { reportID: REPORT_ID, reportName, diff --git a/tests/ui/LHNItemsPresence.tsx b/tests/ui/LHNItemsPresence.tsx index 0f609fb43b89..eb92ed5aa7f9 100644 --- a/tests/ui/LHNItemsPresence.tsx +++ b/tests/ui/LHNItemsPresence.tsx @@ -140,7 +140,7 @@ describe('SidebarLinksData', () => { [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, [ONYXKEYS.BETAS]: betas, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...(reportData ?? {}), ...(otherData ?? {}), }); diff --git a/tests/ui/PaginationTest.tsx b/tests/ui/PaginationTest.tsx index 54686d06a26e..630a4c94b355 100644 --- a/tests/ui/PaginationTest.tsx +++ b/tests/ui/PaginationTest.tsx @@ -232,7 +232,7 @@ async function signInAndGetApp(): Promise { await act(async () => { await Promise.all([ - Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false), + Onyx.merge(ONYXKEYS.IS_LOADING_APP, false), // Simulate setting an unread report and personal details Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, { reportID: REPORT_ID, diff --git a/tests/ui/ProfilePageTest.tsx b/tests/ui/ProfilePageTest.tsx index bd270b06dcde..599677fecff4 100644 --- a/tests/ui/ProfilePageTest.tsx +++ b/tests/ui/ProfilePageTest.tsx @@ -200,7 +200,7 @@ describe('ProfilePage - SMS domain handling', () => { await act(async () => { await Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails); - await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); }); await waitForBatchedUpdatesWithAct(); @@ -240,7 +240,7 @@ describe('ProfilePage - SMS domain handling', () => { await act(async () => { await Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails); - await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); }); await waitForBatchedUpdatesWithAct(); diff --git a/tests/ui/ReportActionsViewTest.tsx b/tests/ui/ReportActionsViewTest.tsx index 59659ba9dde9..059b0b8e5ab0 100644 --- a/tests/ui/ReportActionsViewTest.tsx +++ b/tests/ui/ReportActionsViewTest.tsx @@ -195,10 +195,10 @@ describe('ReportActionsView', () => { mockUseReportTransactionsCollection.mockReturnValue({}); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { + if (key === ONYXKEYS.IS_LOADING_APP) { return [false, {status: 'loaded'}]; } - if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { + if (key === ONYXKEYS.ARE_TRANSLATIONS_LOADING) { return [false, {status: 'loaded'}]; } if (key.includes('reportMetadata')) { @@ -229,10 +229,10 @@ describe('ReportActionsView', () => { }); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { + if (key === ONYXKEYS.IS_LOADING_APP) { return [true, {status: 'loaded'}]; } - if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { + if (key === ONYXKEYS.ARE_TRANSLATIONS_LOADING) { return [false, {status: 'loaded'}]; } if (key.includes('reportMetadata')) { @@ -266,10 +266,10 @@ describe('ReportActionsView', () => { }); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { + if (key === ONYXKEYS.IS_LOADING_APP) { return [false, {status: 'loaded'}]; } - if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { + if (key === ONYXKEYS.ARE_TRANSLATIONS_LOADING) { return [false, {status: 'loaded'}]; } if (key.includes('reportMetadata')) { @@ -298,10 +298,10 @@ describe('ReportActionsView', () => { }); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { + if (key === ONYXKEYS.IS_LOADING_APP) { return [true, {status: 'loaded'}]; } - if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { + if (key === ONYXKEYS.ARE_TRANSLATIONS_LOADING) { return [false, {status: 'loaded'}]; } if (key.includes('reportMetadata')) { @@ -330,10 +330,10 @@ describe('ReportActionsView', () => { }); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { + if (key === ONYXKEYS.IS_LOADING_APP) { return [false, {status: 'loaded'}]; } - if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { + if (key === ONYXKEYS.ARE_TRANSLATIONS_LOADING) { return [false, {status: 'loaded'}]; } if (key.includes('reportMetadata')) { @@ -396,10 +396,10 @@ describe('ReportActionsView', () => { if (key === ONYXKEYS.CONCIERGE_REPORT_ID) { return [CONCIERGE_REPORT_ID, {status: 'loaded'}]; } - if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { + if (key === ONYXKEYS.IS_LOADING_APP) { return [false, {status: 'loaded'}]; } - if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { + if (key === ONYXKEYS.ARE_TRANSLATIONS_LOADING) { return [false, {status: 'loaded'}]; } if (key.includes('reportMetadata')) { diff --git a/tests/ui/ReportAttachments.tsx b/tests/ui/ReportAttachments.tsx index a8101deeff9e..7aae70f2e69c 100644 --- a/tests/ui/ReportAttachments.tsx +++ b/tests/ui/ReportAttachments.tsx @@ -149,7 +149,7 @@ describe('ReportAttachments', () => { global.fetch = getGlobalFetchMock(); wrapOnyxWithWaitForBatchedUpdates(Onyx); await act(async () => { - await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); }); await waitForBatchedUpdatesWithAct(); diff --git a/tests/ui/SessionTest.tsx b/tests/ui/SessionTest.tsx index 476755d398e6..7c2ea776385b 100644 --- a/tests/ui/SessionTest.tsx +++ b/tests/ui/SessionTest.tsx @@ -94,7 +94,7 @@ describe('Deep linking', () => { jest.spyOn(AppActions, 'openApp').mockImplementation(async () => { const originalResult = await originalOpenApp(); await Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, report); - await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); return originalResult; }); }); diff --git a/tests/ui/UnreadIndicatorsTest.tsx b/tests/ui/UnreadIndicatorsTest.tsx index 2229d33840c6..d1af4839f23b 100644 --- a/tests/ui/UnreadIndicatorsTest.tsx +++ b/tests/ui/UnreadIndicatorsTest.tsx @@ -214,7 +214,7 @@ async function signInAndGetAppWithUnreadChat(): Promise { }; await Promise.all([ - Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false), + Onyx.merge(ONYXKEYS.IS_LOADING_APP, false), Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails), Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report), Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, reportActions), diff --git a/tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx b/tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx index cc95606c447c..ef462e550190 100644 --- a/tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx +++ b/tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx @@ -96,7 +96,7 @@ describe('WorkspaceWorkflowsApprovalsEditPage', () => { await act(async () => { await Onyx.clear(); await Onyx.set(ONYXKEYS.HAS_LOADED_APP, true); - await Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); + await Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false); const policy = buildPolicy(); const personalDetails = buildPersonalDetailsList(); diff --git a/tests/ui/components/ProductTrainingContextProvider.tsx b/tests/ui/components/ProductTrainingContextProvider.tsx index ee67580d0bb2..a373e6bf99f7 100644 --- a/tests/ui/components/ProductTrainingContextProvider.tsx +++ b/tests/ui/components/ProductTrainingContextProvider.tsx @@ -65,7 +65,7 @@ describe('ProductTrainingContextProvider', () => { // Set up test environment before each test wrapOnyxWithWaitForBatchedUpdates(Onyx); Onyx.merge(ONYXKEYS.NETWORK, {isOffline: false}); - Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); + Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); signUpWithTestUser(); }); @@ -81,7 +81,7 @@ describe('ProductTrainingContextProvider', () => { describe('Basic Tooltip Registration', () => { it('should not register tooltips when app is loading', async () => { // When app is loading - Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, true); + Onyx.merge(ONYXKEYS.IS_LOADING_APP, true); await waitForBatchedUpdatesWithAct(); const testTooltip = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_TOOLTIP; diff --git a/tests/unit/ContactMethodDetailsPageTest.tsx b/tests/unit/ContactMethodDetailsPageTest.tsx index 81552509fd9a..5ab3fc7a6e26 100644 --- a/tests/unit/ContactMethodDetailsPageTest.tsx +++ b/tests/unit/ContactMethodDetailsPageTest.tsx @@ -134,7 +134,7 @@ describe('ContactMethodDetailsPage', () => { it('calls Navigation.goBack when contact method becomes validated and screen is focused', async () => { Onyx.merge(ONYXKEYS.SESSION, {email: fakeEmail}); - Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); + Onyx.merge(ONYXKEYS.IS_LOADING_REPORT_DATA, false); Onyx.merge(ONYXKEYS.LOGIN_LIST, { [fakeEmail]: { partnerName: 'expensify.com', diff --git a/tests/unit/LocalizeTests.ts b/tests/unit/LocalizeTests.ts index b97d26ca4283..dc84bec2c1ac 100644 --- a/tests/unit/LocalizeTests.ts +++ b/tests/unit/LocalizeTests.ts @@ -56,7 +56,7 @@ describe('localize', () => { Onyx.init({ keys: { NVP_PREFERRED_LOCALE: ONYXKEYS.NVP_PREFERRED_LOCALE, - ARE_TRANSLATIONS_LOADING: ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, + ARE_TRANSLATIONS_LOADING: ONYXKEYS.ARE_TRANSLATIONS_LOADING, SESSION: ONYXKEYS.SESSION, }, }); diff --git a/tests/unit/OnyxDerivedTest.tsx b/tests/unit/OnyxDerivedTest.tsx index 142bad735f98..f3d974cf974c 100644 --- a/tests/unit/OnyxDerivedTest.tsx +++ b/tests/unit/OnyxDerivedTest.tsx @@ -38,7 +38,7 @@ describe('OnyxDerived', () => { beforeEach(async () => { // The reportAttributes locale connection uses initWithStoredValues: false, // so it doesn't fire after Onyx.clear(). Setting this triggers recomputation. - await Onyx.set(ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, false); + await Onyx.set(ONYXKEYS.ARE_TRANSLATIONS_LOADING, false); await waitForBatchedUpdates(); }); diff --git a/tests/unit/ReportActionItemSingleTest.ts b/tests/unit/ReportActionItemSingleTest.ts index 3115a9c7cc77..8d400c96b510 100644 --- a/tests/unit/ReportActionItemSingleTest.ts +++ b/tests/unit/ReportActionItemSingleTest.ts @@ -56,7 +56,7 @@ describe('ReportActionItemSingle', () => { await act(async () => { await Onyx.multiSet({ [ONYXKEYS.PERSONAL_DETAILS_LIST]: fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA]: false, + [ONYXKEYS.IS_LOADING_REPORT_DATA]: false, [ONYXKEYS.COLLECTION.REPORT_ACTIONS]: { [`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${fakeReport.reportID}`]: { [fakeReportAction.reportActionID]: fakeReportAction, diff --git a/tests/unit/SidebarOrderTest.ts b/tests/unit/SidebarOrderTest.ts index 3d2af7271693..6ab60e5f9946 100644 --- a/tests/unit/SidebarOrderTest.ts +++ b/tests/unit/SidebarOrderTest.ts @@ -95,7 +95,7 @@ describe('Sidebar', () => { .then(() => Onyx.multiSet({ [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, }), ) @@ -122,7 +122,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -160,7 +160,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -209,7 +209,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, [`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report1.reportID}`]: 'report1 draft', ...reportCollectionDataSet, }), @@ -256,7 +256,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -319,7 +319,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -393,7 +393,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -472,7 +472,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, [`${ONYXKEYS.COLLECTION.POLICY}${fakeReport.policyID}`]: fakePolicy, ...reportCollectionDataSet, }), @@ -523,7 +523,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, [ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT + report2.reportID]: 'This is a draft', ...reportCollectionDataSet, }), @@ -570,7 +570,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, [`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report.reportID}`]: 'This is a draft', ...reportCollectionDataSet, }), @@ -612,7 +612,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -696,7 +696,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, [`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report2.reportID}`]: 'Report2 draft comment', ...reportCollectionDataSet, }), @@ -754,7 +754,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -816,7 +816,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportDraftCommentCollectionDataSet, ...reportCollectionDataSet, }), @@ -888,7 +888,7 @@ describe('Sidebar', () => { [ONYXKEYS.BETAS]: betas, [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportNameValuePairsCollectionDataSet, ...reportCollectionDataSet, }), @@ -932,7 +932,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -972,7 +972,7 @@ describe('Sidebar', () => { .then(() => Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -1035,7 +1035,7 @@ describe('Sidebar', () => { [ONYXKEYS.BETAS]: betas, [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportNameValuePairsCollectionDataSet, ...reportCollectionDataSet, }), diff --git a/tests/unit/SidebarTest.ts b/tests/unit/SidebarTest.ts index 81940ec35630..2c8d3c6e8206 100644 --- a/tests/unit/SidebarTest.ts +++ b/tests/unit/SidebarTest.ts @@ -95,7 +95,7 @@ describe('Sidebar', () => { [ONYXKEYS.BETAS]: betas, [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportNameValuePairsCollection, ...reportCollection, ...reportAction, @@ -158,7 +158,7 @@ describe('Sidebar', () => { [ONYXKEYS.BETAS]: betas, [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportNameValuePairsCollection, ...reportCollection, ...reportAction,