Skip to content
Draft
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
4 changes: 2 additions & 2 deletions __mocks__/react-native-onyx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import type {ConnectOptions, OnyxKey} from 'react-native-onyx';

// eslint-disable-next-line no-restricted-imports
import Onyx, {useOnyx} from 'react-native-onyx';
import Onyx, {useOnyx, useOnyxState} from 'react-native-onyx';

let connectCallbackDelay = 0;
function addDelayToConnectCallback(delay: number) {
Expand Down Expand Up @@ -41,4 +41,4 @@ const reactNativeOnyxMock: ReactNativeOnyxMock = {

export default reactNativeOnyxMock;

export {useOnyx};
export {useOnyx, useOnyxState};
2 changes: 0 additions & 2 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,6 @@ const ONYXKEYS = {
REPORT_TRANSACTIONS_AND_VIOLATIONS: 'reportTransactionsAndViolations',
OUTSTANDING_REPORTS_BY_POLICY_ID: 'outstandingReportsByPolicyID',
VISIBLE_REPORT_ACTIONS: 'visibleReportActions',
NON_PERSONAL_AND_WORKSPACE_CARD_LIST: 'nonPersonalAndWorkspaceCardList',
PERSONAL_AND_WORKSPACE_CARD_LIST: 'personalAndWorkspaceCardList',
CARD_FEED_ERRORS: 'cardFeedErrors',
RAM_ONLY_SORTED_REPORT_ACTIONS: 'sortedReportActions',
Expand Down Expand Up @@ -2020,7 +2019,6 @@ type OnyxDerivedValuesMapping = {
[ONYXKEYS.DERIVED.REPORT_TRANSACTIONS_AND_VIOLATIONS]: OnyxTypes.ReportTransactionsAndViolationsDerivedValue;
[ONYXKEYS.DERIVED.OUTSTANDING_REPORTS_BY_POLICY_ID]: OnyxTypes.OutstandingReportsByPolicyIDDerivedValue;
[ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS]: OnyxTypes.VisibleReportActionsDerivedValue;
[ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST]: OnyxTypes.NonPersonalAndWorkspaceCardListDerivedValue;
[ONYXKEYS.DERIVED.PERSONAL_AND_WORKSPACE_CARD_LIST]: OnyxTypes.PersonalAndWorkspaceCardListDerivedValue;
[ONYXKEYS.DERIVED.CARD_FEED_ERRORS]: OnyxTypes.CardFeedErrorsDerivedValue;
[ONYXKEYS.DERIVED.RAM_ONLY_SORTED_REPORT_ACTIONS]: OnyxTypes.SortedReportActionsDerivedValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useNavigateToTransactionThread from '@hooks/useNavigateToTransactionThread';
import useNetwork from '@hooks/useNetwork';
import useNonPersonalAndWorkspaceCardList from '@hooks/useNonPersonalAndWorkspaceCardList';
import useOnyx from '@hooks/useOnyx';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useResponsiveLayoutOnWideRHP from '@hooks/useResponsiveLayoutOnWideRHP';
Expand Down Expand Up @@ -210,7 +211,7 @@ function MoneyRequestReportTransactionList({
const navigateToTransactionThread = useNavigateToTransactionThread();
const longPressModalRef = useRef<MoneyRequestReportTransactionLongPressModalHandle>(null);
const {isOffline} = useNetwork();
const [nonPersonalAndWorkspaceCards] = useOnyx(ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST);
const nonPersonalAndWorkspaceCards = useNonPersonalAndWorkspaceCardList();
const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${report?.policyID}`);
const [policyTagLists] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${report?.policyID}`);

Expand Down
3 changes: 2 additions & 1 deletion src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import useHasMultipleSplitChildren from '@hooks/useHasMultipleSplitChildren';
import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useNonPersonalAndWorkspaceCardList from '@hooks/useNonPersonalAndWorkspaceCardList';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import {usePersonalDetail} from '@hooks/usePersonalDetails';
Expand Down Expand Up @@ -280,7 +281,7 @@ function MoneyRequestView({
const [policyVendors] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_VENDORS}${getNonEmptyStringOnyxID(policyID)}`);
const targetPolicyID = updatedTransaction?.reportID ? parentReport?.policyID : policyID;
const [policyTagList] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(targetPolicyID)}`);
const [nonPersonalAndWorkspaceCards] = useOnyx(ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST);
const nonPersonalAndWorkspaceCards = useNonPersonalAndWorkspaceCardList();
const transactionCard = transaction?.cardID ? nonPersonalAndWorkspaceCards?.[transaction.cardID] : undefined;
const [cardList] = useOnyx(ONYXKEYS.CARD_LIST);
const [cardFeedsForTransactionCard] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER}${getNonEmptyStringOnyxID(transactionCard?.fundID)}`);
Expand Down
3 changes: 2 additions & 1 deletion src/components/Search/SearchQueryProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import useCardFeedsForDisplay from '@hooks/useCardFeedsForDisplay';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useLoadSearchCategoryData from '@hooks/useLoadSearchCategoryData';
import useNonPersonalAndWorkspaceCardList from '@hooks/useNonPersonalAndWorkspaceCardList';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import usePreviousDefined from '@hooks/usePreviousDefined';
Expand Down Expand Up @@ -64,7 +65,7 @@ function SearchQueryProvider({children}: SearchQueryProviderProps) {
useLoadSearchCategoryData({shouldLoad: shouldLoadCategoryData});

const {defaultCardFeed, activeExpensifyCardFeedID} = useCardFeedsForDisplay();
const [defaultExpensifyCardID] = useOnyx(ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST, {selector: (card) => defaultExpensifyCardSelector(card)?.id});
const defaultExpensifyCardID = useNonPersonalAndWorkspaceCardList((card) => defaultExpensifyCardSelector(card)?.id);
const {accountID, email} = useCurrentUserPersonalDetails();
const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
const defaultCardFeedID = defaultCardFeed?.id;
Expand Down
3 changes: 2 additions & 1 deletion src/components/Search/hooks/useSearchSnapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'
import useLocalize from '@hooks/useLocalize';
import useMultipleSnapshots from '@hooks/useMultipleSnapshots';
import useNetwork from '@hooks/useNetwork';
import useNonPersonalAndWorkspaceCardList from '@hooks/useNonPersonalAndWorkspaceCardList';
import useOnyx from '@hooks/useOnyx';
import {useAllPersonalDetails} from '@hooks/usePersonalDetails';
import usePolicyForMovingExpenses from '@hooks/usePolicyForMovingExpenses';
Expand Down Expand Up @@ -140,7 +141,7 @@ function useSearchSnapshot({queryJSON, searchResults, transactions, reportAction
const [onyxPersonalDetailsList] = useAllPersonalDetails();
const [cardFeeds] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER);
const [personalAndWorkspaceCards] = useOnyx(ONYXKEYS.DERIVED.PERSONAL_AND_WORKSPACE_CARD_LIST);
const [nonPersonalAndWorkspaceCards] = useOnyx(ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST);
const nonPersonalAndWorkspaceCards = useNonPersonalAndWorkspaceCardList();
const [customCardNames] = useOnyx(ONYXKEYS.NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMES);
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
const [policyCategories] = useOnyx(ONYXKEYS.COLLECTION.POLICY_CATEGORIES);
Expand Down
3 changes: 2 additions & 1 deletion src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import useDelegateAccountID from '@hooks/useDelegateAccountID';
import type {ActionHandledType} from '@hooks/useHoldMenuSubmit';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useNonPersonalAndWorkspaceCardList from '@hooks/useNonPersonalAndWorkspaceCardList';
import useOnyx from '@hooks/useOnyx';
import usePolicyForMovingExpenses from '@hooks/usePolicyForMovingExpenses';
import usePrevious from '@hooks/usePrevious';
Expand Down Expand Up @@ -194,7 +195,7 @@ function Search({
const {accountID, email} = useCurrentUserPersonalDetails();
const personalDetails = usePersonalDetails();
const isActionLoadingSet = useActionLoadingReportIDs();
const [nonPersonalAndWorkspaceCards] = useOnyx(ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST);
const nonPersonalAndWorkspaceCards = useNonPersonalAndWorkspaceCardList();

const isExpenseReportType = type === CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT;

Expand Down
7 changes: 5 additions & 2 deletions src/components/Table/TableBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ function TableBodyList({contentContainerStyle, emptyMessage, onLayout, style, ..
noResultsStateElement,
tableListMetadata,
isEmptyResult,
isDefaultViewEmpty,
scrollWidth,
tableWidth,
} = useTableContext<TableData>();
Expand Down Expand Up @@ -337,8 +338,10 @@ function TableBodyList({contentContainerStyle, emptyMessage, onLayout, style, ..
</View>
);

const emptyStateContent =
tableListMetadata.hasPageHeader && isEmptyResult ? (noResultsStateElement ?? EmptyResultComponent) : (emptyStateElement ?? renderListComponent(ListEmptyComponent));
// When the default view hides every row (e.g. all workspaces are archived), no search or filter is active,
// so show the empty state rather than "No results".
const shouldShowNoResultsState = tableListMetadata.hasPageHeader && isEmptyResult && !isDefaultViewEmpty;
const emptyStateContent = shouldShowNoResultsState ? (noResultsStateElement ?? EmptyResultComponent) : (emptyStateElement ?? renderListComponent(ListEmptyComponent));
const footerElement = renderListComponent(ListFooterComponent);
// Consumer footer flex growth is useful below normal rows, but inside the combined empty-state
// footer it can expand over the page header. Preserve the remaining style while disabling growth.
Expand Down
5 changes: 3 additions & 2 deletions src/components/Table/TableEmptyStates/TableNoResultsState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ type TableNoResultsStateProps = Omit<GenericEmptyStateComponentProps, 'headerMed
export default function TableNoResultsState(emptyStateProps: TableNoResultsStateProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const {isEmptyResult, tableListMetadata} = useTableContext();
const {isEmptyResult, isDefaultViewEmpty, tableListMetadata} = useTableContext();
const illustrations = useMemoizedLazyIllustrations(['EmptyShelves']);

if (!isEmptyResult) {
// The default view hiding every row is not a search/filter result, so the empty state handles it instead.
if (!isEmptyResult || isDefaultViewEmpty) {
return null;
}

Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useCardFeedsForDisplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {expensifyCardFeedsForDisplaySelector} from '@selectors/Card';
import useExpensifyCardFeedsForFeedSelector from './useExpensifyCardFeedsForFeedSelector';
import useFeedKeysWithAssignedCards from './useFeedKeysWithAssignedCards';
import useLocalize from './useLocalize';
import useNonPersonalAndWorkspaceCardList from './useNonPersonalAndWorkspaceCardList';
import useOnyx from './useOnyx';

const eligiblePoliciesSelector = (policies: OnyxCollection<Policy>): string[] => {
Expand Down Expand Up @@ -108,7 +109,7 @@ const useCardFeedsForDisplay = () => {
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
const feedKeysWithCards = useFeedKeysWithAssignedCards();
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID);
const [expensifyCardFeeds] = useOnyx(ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST, {selector: expensifyCardFeedsForDisplaySelector});
const expensifyCardFeeds = useNonPersonalAndWorkspaceCardList(expensifyCardFeedsForDisplaySelector);
const eligiblePoliciesIDsArray = eligiblePoliciesSelector(allPolicies);

const cardFeedsByPolicy = getCardFeedsForDisplayPerPolicy(allFeeds, translate, feedKeysWithCards, allPolicies);
Expand Down
42 changes: 42 additions & 0 deletions src/hooks/useNonPersonalAndWorkspaceCardList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import ONYXKEYS from '@src/ONYXKEYS';
import type {CardList, WorkspaceCardsList} from '@src/types/onyx';

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

import {nonPersonalAndWorkspaceCardListSelector} from '@selectors/Card';
import {useOnyxState} from 'react-native-onyx';

type CardListSelector<TReturn> = (cardList: CardList) => TReturn;

const dependencies = [ONYXKEYS.CARD_LIST, ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST];

// useOnyxState runs the selector on every write to either key, so each selector's output is kept per merged list
const selectedValues = new WeakMap<CardListSelector<unknown>, {cardList: CardList; value: unknown}>();

function select<TReturn>(selector: CardListSelector<TReturn>, cardList: CardList): TReturn {
const cached = selectedValues.get(selector);
if (cached?.cardList === cardList) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
return cached.value as TReturn;
}
const value = selector(cardList);
selectedValues.set(selector, {cardList, value});
return value;
}

function useNonPersonalAndWorkspaceCardList(): CardList;
function useNonPersonalAndWorkspaceCardList<TReturn>(selector: CardListSelector<TReturn>): TReturn;
function useNonPersonalAndWorkspaceCardList<TReturn>(selector?: CardListSelector<TReturn>) {
return useOnyxState(
(state) => {
// useOnyxState's state view types a collection key as one member, but at runtime it returns the whole collection
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
const workspaceCardFeeds = state[ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST] as OnyxCollection<WorkspaceCardsList>;
const cardList = nonPersonalAndWorkspaceCardListSelector(state[ONYXKEYS.CARD_LIST], workspaceCardFeeds);
return selector ? select(selector, cardList) : cardList;
},
{dependencies},
);
}

export default useNonPersonalAndWorkspaceCardList;
3 changes: 2 additions & 1 deletion src/hooks/useSearchBulkActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ import {useMemoizedLazyExpensifyIcons} from './useLazyAsset';
import useLoadSearchCardData from './useLoadSearchCardData';
import useLocalize from './useLocalize';
import useNetwork from './useNetwork';
import useNonPersonalAndWorkspaceCardList from './useNonPersonalAndWorkspaceCardList';
import useOnyx from './useOnyx';
import {getParticipantsInvoiceReport} from './useParticipantsInvoiceReport';
import usePaymentContext from './usePaymentContext';
Expand Down Expand Up @@ -730,7 +731,7 @@ function useSearchBulkActions({queryJSON}: UseSearchBulkActionsParams) {
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});
const [rules] = useOnyx(ONYXKEYS.COLLECTION.RULE);
const [cardList] = useOnyx(ONYXKEYS.CARD_LIST);
const [nonPersonalAndWorkspaceCards] = useOnyx(ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST);
const nonPersonalAndWorkspaceCards = useNonPersonalAndWorkspaceCardList();
// "Auto report" cannot read a card's absence as no access until every card has arrived.
const {areCardsLoaded: isSearchCardListComplete} = useLoadSearchCardData();
const getPersonalDetailsByLogin = useGetPersonalDetailsByLogin();
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useSearchSections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {useCurrencyListActions} from './useCurrencyList';
import useCurrentUserPersonalDetails from './useCurrentUserPersonalDetails';
import useFilterPendingDeleteReports from './useFilterPendingDeleteReports';
import useLocalize from './useLocalize';
import useNonPersonalAndWorkspaceCardList from './useNonPersonalAndWorkspaceCardList';
import useOnyx from './useOnyx';
import useReportAttributes from './useReportAttributes';

Expand All @@ -29,7 +30,7 @@ function useSearchSections(): UseSearchSectionsResult {

const [cardFeeds] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER);
const [personalAndWorkspaceCards] = useOnyx(ONYXKEYS.DERIVED.PERSONAL_AND_WORKSPACE_CARD_LIST);
const [nonPersonalAndWorkspaceCards] = useOnyx(ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST);
const nonPersonalAndWorkspaceCards = useNonPersonalAndWorkspaceCardList();
const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST);

const [reportNameValuePairs] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS);
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useSearchTypeMenuSections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import useCreateEmptyReportConfirmation from './useCreateEmptyReportConfirmation
import useHasReportAwaitingApproval from './useHasReportAwaitingApproval';
import useMappedPolicies from './useMappedPolicies';
import useNetwork from './useNetwork';
import useNonPersonalAndWorkspaceCardList from './useNonPersonalAndWorkspaceCardList';
import useOnyx from './useOnyx';
import usePermissions from './usePermissions';

Expand Down Expand Up @@ -58,7 +59,7 @@ const currentUserLoginAndAccountIDSelector = (session: OnyxEntry<Session>) => ({
* reliably, so this hook never depends on a navigation context itself.
*/
const useSearchTypeMenuSections = (isScreenFocused = true) => {
const [defaultExpensifyCard] = useOnyx(ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST, {selector: defaultExpensifyCardSelector});
const defaultExpensifyCard = useNonPersonalAndWorkspaceCardList(defaultExpensifyCardSelector);

const {defaultCardFeed, cardFeedsByPolicy, activeExpensifyCardFeedID} = useCardFeedsForDisplay();

Expand Down
2 changes: 0 additions & 2 deletions src/libs/actions/OnyxDerived/ONYX_DERIVED_VALUES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type {OnyxDerivedValueConfig} from './types';
import cardFeedErrorsConfig from './configs/cardFeedErrors';
import guideAccountIDsConfig from './configs/guideAccountIDs';
import loginToAccountIDMapConfig from './configs/loginToAccountIDMap';
import nonPersonalAndWorkspaceCardListConfig from './configs/nonPersonalAndWorkspaceCardList';
import oneOnOneChatReportIDsConfig from './configs/oneOnOneChatReportIDs';
import outstandingReportsByPolicyIDConfig from './configs/outstandingReportsByPolicyID';
import personalAndWorkspaceCardListConfig from './configs/personalAndWorkspaceCardList';
Expand All @@ -26,7 +25,6 @@ const ONYX_DERIVED_VALUES = {
[ONYXKEYS.DERIVED.REPORT_TRANSACTIONS_AND_VIOLATIONS]: reportTransactionsAndViolationsConfig,
[ONYXKEYS.DERIVED.OUTSTANDING_REPORTS_BY_POLICY_ID]: outstandingReportsByPolicyIDConfig,
[ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS]: visibleReportActionsConfig,
[ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST]: nonPersonalAndWorkspaceCardListConfig,
[ONYXKEYS.DERIVED.PERSONAL_AND_WORKSPACE_CARD_LIST]: personalAndWorkspaceCardListConfig,
[ONYXKEYS.DERIVED.CARD_FEED_ERRORS]: cardFeedErrorsConfig,
[ONYXKEYS.DERIVED.RAM_ONLY_SORTED_REPORT_ACTIONS]: sortedReportActionsConfig,
Expand Down

This file was deleted.

3 changes: 2 additions & 1 deletion src/pages/Search/SearchTransactionsChangeReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import useHydrateReportsFromSnapshot from '@hooks/useHydrateReportsFromSnapshot'
import useLoadSearchCardData from '@hooks/useLoadSearchCardData';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useNonPersonalAndWorkspaceCardList from '@hooks/useNonPersonalAndWorkspaceCardList';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import usePersonalPolicy from '@hooks/usePersonalPolicy';
Expand Down Expand Up @@ -91,7 +92,7 @@ function SearchTransactionsChangeReport() {
const managedCardTransactionID = transactions.find((transaction) => isUnreportedManagedCardTransaction(transaction))?.transactionID;
const hasUnreportedManagedCardTransactions = !!managedCardTransactionID;
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
const [nonPersonalAndWorkspaceCards] = useOnyx(ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST);
const nonPersonalAndWorkspaceCards = useNonPersonalAndWorkspaceCardList();
// Asked for here too, so opening this screen retries a fetch that failed earlier.
const {areCardsLoaded: isSearchCardListComplete} = useLoadSearchCardData();
const reports = useChangeTransactionsReportReports(transactions, undefined);
Expand Down
Loading