Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions config/oxlint/oxlint.seatbelt.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,6 @@
"../../src/pages/settings/useInitialSettingsPageMenuData.ts" "rulesdir/no-onyx-loading-status" 1
"../../src/pages/settings/VerifyAccountPageBase.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/AddCardToDigitalWalletPage.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/AddCardToDigitalWalletPage.tsx" "rulesdir/no-onyx-loading-status" 1
"../../src/pages/settings/Wallet/AddDebitCardPage.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/BankAccountPurposePage/index.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/BankAccountPurposePage/substeps/CountrySelection.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1
Expand All @@ -1456,11 +1455,9 @@
"../../src/pages/settings/Wallet/EnableGlobalReimbursements/Wise/WiseBusinessOnboardingPage.tsx" "rulesdir/no-onyx-loading-status" 1
"../../src/pages/settings/Wallet/ExpensifyCardPage/ChangePINPage.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/ExpensifyCardPage/index.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/ExpensifyCardPage/index.tsx" "rulesdir/no-onyx-loading-status" 1
"../../src/pages/settings/Wallet/ImportTransactionsCardNamePage.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/ImportTransactionsCurrencyPage.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/ImportTransactionsPage.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/ImportTransactionsSpreadsheetPage.tsx" "rulesdir/no-onyx-loading-status" 1
"../../src/pages/settings/Wallet/InternationalDepositAccount/index.tsx" "rulesdir/no-onyx-loading-status" 1
"../../src/pages/settings/Wallet/InternationalDepositAccount/InternationalDepositAccountContent.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/InternationalDepositAccount/subPages/AccountFlowEntryPoint.tsx" "no-restricted-imports" 1
Expand All @@ -1475,16 +1472,12 @@
"../../src/pages/settings/Wallet/PersonalCardDetailsPage.tsx" "@typescript-eslint/no-unnecessary-type-assertion" 1
"../../src/pages/settings/Wallet/PersonalCardDetailsPage.tsx" "@typescript-eslint/no-unsafe-type-assertion" 2
"../../src/pages/settings/Wallet/PersonalCardDetailsPage.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/PersonalCardDetailsPage.tsx" "rulesdir/no-onyx-loading-status" 1
"../../src/pages/settings/Wallet/PersonalCardEditNamePage.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/PersonalCardEditNamePage.tsx" "rulesdir/no-onyx-loading-status" 1
"../../src/pages/settings/Wallet/PersonalCardEditTransactionStartDatePage.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/PersonalCards/AddNewCardPage.tsx" "rulesdir/no-onyx-loading-status" 1
"../../src/pages/settings/Wallet/PersonalCards/FixPersonalCardConnectionPage/index.native.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/PersonalCards/FixPersonalCardConnectionPage/index.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/PersonalCards/FixPersonalCardConnectionPage/useFixPersonalCardConnection.ts" "@typescript-eslint/no-unnecessary-type-assertion" 2
"../../src/pages/settings/Wallet/PersonalCards/FixPersonalCardConnectionPage/useFixPersonalCardConnection.ts" "@typescript-eslint/no-unsafe-type-assertion" 2
"../../src/pages/settings/Wallet/PersonalCards/FixPersonalCardConnectionPage/useFixPersonalCardConnection.ts" "rulesdir/no-onyx-loading-status" 1
"../../src/pages/settings/Wallet/PersonalCards/steps/BankConnection/index.native.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/PersonalCards/steps/BankConnection/index.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/PersonalCards/steps/PlaidConnectionStep.tsx" "no-restricted-imports" 1
Expand All @@ -1501,11 +1494,9 @@
"../../src/pages/settings/Wallet/ShareBankAccount/ShareBankAccount.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/ShareBankAccount/ShareBankAccount.tsx" "react-hooks/set-state-in-effect" 1
"../../src/pages/settings/Wallet/TransactionsImportedPage.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/TransactionsImportedPage.tsx" "rulesdir/no-onyx-loading-status" 1
"../../src/pages/settings/Wallet/TransferBalancePage.tsx" "@typescript-eslint/no-deprecated/MenuItem" 1
"../../src/pages/settings/Wallet/TransferBalancePage.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/TravelCVVPage/TravelCVVPage.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/TravelCVVPage/TravelCVVPage.tsx" "rulesdir/no-onyx-loading-status" 2
"../../src/pages/settings/Wallet/UnshareBankAccount/UnshareBankAccount.tsx" "no-restricted-imports" 1
"../../src/pages/settings/Wallet/UpdatePersonalBankAccountPage.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1
"../../src/pages/settings/Wallet/UpdatePersonalBankAccountPage.tsx" "no-restricted-imports" 1
Expand Down
5 changes: 2 additions & 3 deletions src/pages/settings/Wallet/AddCardToDigitalWalletPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES, {DYNAMIC_ROUTES} from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';

import {cardByIdSelector} from '@selectors/Card';
import React, {useEffect, useRef, useState} from 'react';
Expand All @@ -58,7 +57,7 @@ function AddCardToDigitalWalletPage({
const illustrations = useMemoizedLazyIllustrations(['CardIntoWallet', 'ThumbsUpStars', 'CardDenied']);
const primaryLogin = usePrimaryContactMethod();

const [card, cardMetadata] = useOnyx(ONYXKEYS.CARD_LIST, {selector: cardByIdSelector(cardID)});
const [card] = useOnyx(ONYXKEYS.CARD_LIST, {selector: cardByIdSelector(cardID)});
const [isCheckingPendingApproval] = useOnyx(ONYXKEYS.RAM_ONLY_IS_CHECKING_PENDING_WALLET_APPROVAL);
const currentCardID = card?.cardID;
const latestError = getLatestErrorMessageField(card);
Expand Down Expand Up @@ -116,7 +115,7 @@ function AddCardToDigitalWalletPage({

const isWaitingForPendingApproval = !isOffline && isCheckingPendingApproval !== false && !hasPendingApproval && !submittedRequest;

if (isWaitingForPendingApproval || (!card && isLoadingOnyxValue(cardMetadata))) {
if (isWaitingForPendingApproval) {
return <FullScreenLoadingIndicator onGoBack={goBackToEntryPoint} />;
}

Expand Down
6 changes: 2 additions & 4 deletions src/pages/settings/Wallet/ExpensifyCardPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ import ROUTES, {DYNAMIC_ROUTES} from '@src/ROUTES';
import SCREENS from '@src/SCREENS';
import INPUT_IDS from '@src/types/form/PersonalDetailsForm';
import type {Policy} from '@src/types/onyx';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';

import type {ViewStyle} from 'react-native';
import type {OnyxCollection} from 'react-native-onyx';
Expand Down Expand Up @@ -125,7 +124,6 @@ function ExpensifyCardPage({route}: ExpensifyCardPageProps) {
const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS);
const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE);
const cardList = useNonPersonalCardList();
const [, cardListResult] = useOnyx(ONYXKEYS.CARD_LIST);
const [hasLoadedApp] = useOnyx(ONYXKEYS.HAS_LOADED_APP);
const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP);
const [cardSettings] = useOnyx(`${ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS}${cardList?.[cardID]?.fundID}`);
Expand Down Expand Up @@ -295,8 +293,8 @@ function ExpensifyCardPage({route}: ExpensifyCardPageProps) {
const navigateToTransactions = () => navigateToCardTransactions(cardID);

// Show the loading indicator instead of the NotFoundPage while the card could still arrive: Before the app has loaded for the first time (hasLoadedApp),
// while an OpenApp/reconnect is in flight (isLoadingApp), or while CARD_LIST is still hydrating.
const isLoadingCardData = !currentCard && (!hasLoadedApp || !!isLoadingApp || isLoadingOnyxValue(cardListResult));
// or while an OpenApp/reconnect is in flight (isLoadingApp).
const isLoadingCardData = !currentCard && (!hasLoadedApp || !!isLoadingApp);

if (isLoadingCardData) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import type {CardList} from '@src/types/onyx';
import type {FileObject} from '@src/types/utils/Attachment';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';

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

Expand All @@ -30,7 +29,7 @@ function ImportTransactionsSpreadsheetPage({route}: ImportTransactionsSpreadshee
const existingCardID = cardID ? Number(cardID) : undefined;
const backTo = cardID ? undefined : ROUTES.SETTINGS_WALLET_IMPORT_TRANSACTIONS;
const [importedSpreadsheet] = useOnyx(ONYXKEYS.IMPORTED_SPREADSHEET);
const [savedColumnLayouts, savedColumnLayoutsMetadata] = useOnyx(ONYXKEYS.NVP_SAVED_CSV_COLUMN_LAYOUT_LIST);
const [savedColumnLayouts] = useOnyx(ONYXKEYS.NVP_SAVED_CSV_COLUMN_LAYOUT_LIST);
const [accountID = CONST.DEFAULT_NUMBER_ID] = useOnyx(ONYXKEYS.SESSION, {selector: accountIDSelector});
const cardSelector = (cardList: OnyxEntry<CardList>) => (cardID ? cardByIdSelector(String(cardID))(cardList) : undefined);
const [existingCard] = useOnyx(ONYXKEYS.CARD_LIST, {selector: cardSelector});
Expand All @@ -42,7 +41,7 @@ function ImportTransactionsSpreadsheetPage({route}: ImportTransactionsSpreadshee

// Importing a spreadsheet stores the name the person gave the card where its account number goes,
// and UploadOFX rejects a statement for a card holding a name.
const hasImportedSpreadsheet = isLoadingOnyxValue(savedColumnLayoutsMetadata) || !!previouslySavedLayout;
const hasImportedSpreadsheet = !!previouslySavedLayout;

const uploadStatement = async (file: FileObject) => {
// Re-uploading to an existing card skips the settings step, so keep the configuration the card was imported with
Expand Down
6 changes: 2 additions & 4 deletions src/pages/settings/Wallet/PersonalCardDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import ONYXKEYS from '@src/ONYXKEYS';
import {DYNAMIC_ROUTES} from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import type {CompanyCardFeed} from '@src/types/onyx';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';

import {format} from 'date-fns';
import React from 'react';
Expand All @@ -71,7 +70,7 @@ function PersonalCardDetailsPage({route}: PersonalCardDetailsPageProps) {

const {isOffline} = useNetwork();

const [cardList, cardListMetadata] = useOnyx(ONYXKEYS.CARD_LIST);
const [cardList] = useOnyx(ONYXKEYS.CARD_LIST);
const [allTransactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION);
const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT);
const [savedColumnLayouts] = useOnyx(ONYXKEYS.NVP_SAVED_CSV_COLUMN_LAYOUT_LIST);
Expand Down Expand Up @@ -167,8 +166,7 @@ function PersonalCardDetailsPage({route}: PersonalCardDetailsPageProps) {

const navigateToTransactions = () => navigateToCardTransactions(cardID);

// Don't show NotFoundPage if data is still loading
if (!card && !isLoadingOnyxValue(cardListMetadata)) {
if (!card) {
return <NotFoundPage />;
}

Expand Down
7 changes: 1 addition & 6 deletions src/pages/settings/Wallet/PersonalCardEditNamePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {DYNAMIC_ROUTES} from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import INPUT_IDS from '@src/types/form/EditPersonalCardNameForm';
import type {CardList} from '@src/types/onyx';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';

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

Expand All @@ -40,7 +39,7 @@ type PersonalCardEditNamePageProps = PlatformStackScreenProps<SettingsNavigatorP
function PersonalCardEditNamePage({route}: PersonalCardEditNamePageProps) {
const {cardID} = route.params;
const backPath = useDynamicBackPath(DYNAMIC_ROUTES.PERSONAL_CARD_EDIT_NAME.path);
const [customCardNames, customCardNamesMetadata] = useOnyx(ONYXKEYS.NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMES);
const [customCardNames] = useOnyx(ONYXKEYS.NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMES);
const cardSelector = (cardList: OnyxEntry<CardList>) => cardByIdSelector(cardID)(cardList);
const [card] = useOnyx(ONYXKEYS.CARD_LIST, {selector: cardSelector});
const [cardholder] = usePersonalDetail(card?.accountID);
Expand Down Expand Up @@ -68,10 +67,6 @@ function PersonalCardEditNamePage({route}: PersonalCardEditNamePageProps) {
return errors;
};

if (isLoadingOnyxValue(customCardNamesMetadata)) {
return null;
}

return (
<ScreenWrapper
testID="PersonalCardEditNamePage"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
import {ModalActions} from '@components/Modal/Global/ModalContext';

import useConfirmModal from '@hooks/useConfirmModal';
Expand All @@ -15,7 +14,6 @@ import {clearAddNewPersonalCardFlow} from '@userActions/PersonalCards';

import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';

import {guidedSetupAndTourStatusSelector} from '@selectors/Onboarding';
import React, {useEffect, useState} from 'react';
Expand All @@ -29,7 +27,7 @@ import SuccessStep from './steps/SuccessStep';

function AddPersonalNewCardPage() {
const styles = useThemeStyles();
const [addNewPersonalCardFeed, addNewPersonalCardFeedMetadata] = useOnyx(ONYXKEYS.ADD_NEW_PERSONAL_CARD);
const [addNewPersonalCardFeed] = useOnyx(ONYXKEYS.ADD_NEW_PERSONAL_CARD);
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [guidedSetupAndTourStatus] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: guidedSetupAndTourStatusSelector});
Expand All @@ -42,18 +40,13 @@ function AddPersonalNewCardPage() {
const {translate} = useLocalize();
const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
const delegateAccountID = useDelegateAccountID();
const isAddCardFeedLoading = isLoadingOnyxValue(addNewPersonalCardFeedMetadata);

useEffect(() => {
return () => {
clearAddNewPersonalCardFlow();
};
}, []);

if (isAddCardFeedLoading) {
return <FullScreenLoadingIndicator />;
}

let CurrentStep: React.JSX.Element;
switch (currentStep) {
case CONST.PERSONAL_CARDS.STEP.SUCCESS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import {DYNAMIC_ROUTES} from '@src/ROUTES';
import type {CompanyCardFeed} from '@src/types/onyx';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';

import {useEffect, useRef} from 'react';

function useFixPersonalCardConnection(cardID: string) {
const {isOffline} = useNetwork();
const cardDetailsPath = useDynamicBackPath(DYNAMIC_ROUTES.PERSONAL_CARD_FIX_CONNECTION.path);

const [cardList, cardListMetadata] = useOnyx(ONYXKEYS.CARD_LIST);
const [cardList] = useOnyx(ONYXKEYS.CARD_LIST);
const card = cardList?.[cardID];
const bankDisplayName = card ? getBankName(card.bank as CompanyCardFeed) : '';
const isPlaid = !!(card?.bank && getPlaidInstitutionId(card.bank as CompanyCardFeed));
Expand All @@ -34,9 +33,6 @@ function useFixPersonalCardConnection(cardID: string) {
const hasSyncedRef = useRef(false);

useEffect(() => {
if (isLoadingOnyxValue(cardListMetadata)) {
return;
}
// The Plaid flow drives its own SyncCard from onSuccess, so skip the auto-sync here.
// A broken card is only kept on this page when there is a bank connection to send it to. Without one the page
// has nothing to offer, so it falls through to the sync below rather than stranding the user here.
Expand All @@ -46,7 +42,7 @@ function useFixPersonalCardConnection(cardID: string) {
hasSyncedRef.current = true;
updatePersonalCardConnection(card.cardID.toString(), card.lastScrapeResult);
Navigation.goBack(cardDetailsPath);
}, [isCardBroken, card, cardDetailsPath, cardListMetadata, isPlaid, url]);
}, [isCardBroken, card, cardDetailsPath, isPlaid, url]);

return {card, bankDisplayName, url, isCardBroken, isOffline, isPlaid, country, cardDetailsPath};
}
Expand Down
7 changes: 1 addition & 6 deletions src/pages/settings/Wallet/TransactionsImportedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import type {CardList} from '@src/types/onyx';
import type {Errors} from '@src/types/onyx/OnyxCommon';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';

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

Expand All @@ -36,7 +35,7 @@ type TransactionsImportedPageProps = PlatformStackScreenProps<SettingsNavigatorP
function TransactionsImportedPage({route}: TransactionsImportedPageProps) {
const {cardID: existingCardID} = route.params ?? {};
const {translate} = useLocalize();
const [spreadsheet, spreadsheetMetadata] = useOnyx(ONYXKEYS.IMPORTED_SPREADSHEET);
const [spreadsheet] = useOnyx(ONYXKEYS.IMPORTED_SPREADSHEET);
const [savedColumnLayouts] = useOnyx(ONYXKEYS.NVP_SAVED_CSV_COLUMN_LAYOUT_LIST);
const [accountID = CONST.DEFAULT_NUMBER_ID] = useOnyx(ONYXKEYS.SESSION, {selector: accountIDSelector});
const cardSelector = (cardList: OnyxEntry<CardList>) => (existingCardID ? cardByIdSelector(String(existingCardID))(cardList) : undefined);
Expand Down Expand Up @@ -141,10 +140,6 @@ function TransactionsImportedPage({route}: TransactionsImportedPageProps) {
closeImportPageAndModal();
};

if (!spreadsheet && isLoadingOnyxValue(spreadsheetMetadata)) {
return null;
}

const spreadsheetColumns = spreadsheet?.data;

if (!spreadsheetColumns) {
Expand Down
14 changes: 3 additions & 11 deletions src/pages/settings/Wallet/TravelCVVPage/TravelCVVPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import SCREENS from '@src/SCREENS';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';

import {useNavigationState} from '@react-navigation/native';
import React, {useEffect, useRef} from 'react';
Expand All @@ -41,8 +40,7 @@ function TravelCVVPage() {
const {translate} = useLocalize();
const icons = useMemoizedLazyExpensifyIcons(['Copy', 'Checkmark']);

const [account, accountMetadata] = useOnyx(ONYXKEYS.ACCOUNT);
const [, lockAccountDetailsMetadata] = useOnyx(ONYXKEYS.NVP_PRIVATE_LOCK_ACCOUNT_DETAILS);
const [account] = useOnyx(ONYXKEYS.ACCOUNT);
const {isAccountLocked} = useLockedAccountState();
const {showLockedAccountModal} = useLockedAccountActions();

Expand All @@ -60,8 +58,6 @@ function TravelCVVPage() {
useEffect(() => () => setCvv(null), [setCvv]);

const isSignedInAsDelegate = !!account?.delegatedAccess?.delegate || false;
const isLoadingAccount = isLoadingOnyxValue(accountMetadata);
const isLoadingLockAccountDetails = isLoadingOnyxValue(lockAccountDetailsMetadata);
const isVerifyAccountInStack = useNavigationState((state) => state.routes.some((route) => route.name === SCREENS.SETTINGS.WALLET.TRAVEL_CVV_VERIFY_ACCOUNT));

// Auto-navigate to the validateCode screen on first mount so the user
Expand All @@ -74,15 +70,11 @@ function TravelCVVPage() {
// If the verify-account (validateCode) screen is already in the navigation
// stack, the user has previously visited it during this mount cycle (e.g.
// they completed or cancelled the validateCode flow and returned here).
// Skip auto-navigation so we don't push a duplicate screen. This check
// runs before the loading guards because it doesn't depend on Onyx data.
// Skip auto-navigation so we don't push a duplicate screen.
if (isVerifyAccountInStack) {
hasAutoNavigatedRef.current = true;
return;
}
if (isLoadingAccount || isLoadingLockAccountDetails) {
return;
}
// Permanent conditions — set the ref so we never retry auto-navigation.
// If CVV is already revealed there's no reason to navigate to the validate
// code screen, and delegates are not allowed to request one. Unlike the
Expand All @@ -102,7 +94,7 @@ function TravelCVVPage() {
}
hasAutoNavigatedRef.current = true;
Navigation.navigate(ROUTES.SETTINGS_WALLET_TRAVEL_CVV_VERIFY_ACCOUNT);
}, [isLoadingAccount, isLoadingLockAccountDetails, cvv, isSignedInAsDelegate, isOffline, isAccountLocked, isVerifyAccountInStack]);
}, [cvv, isSignedInAsDelegate, isOffline, isAccountLocked, isVerifyAccountInStack]);

const handleRevealDetailsPress = () => {
if (isAccountLocked) {
Expand Down
Loading