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
6 changes: 4 additions & 2 deletions src/components/MoneyRequestConfirmationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ type MoneyRequestConfirmationListProps = {

type MoneyRequestConfirmationListItem = Participant | OptionData;

const mileageRateSelector = (policy: OnyxEntry<OnyxTypes.Policy>) => DistanceRequestUtils.getDefaultMileageRate(policy);

function MoneyRequestConfirmationList({
transaction,
onSendMoney,
Expand Down Expand Up @@ -244,11 +246,11 @@ function MoneyRequestConfirmationList({
const [policyReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {canBeMissing: true});
const [policyDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${policyID}`, {canBeMissing: true});
const [defaultMileageRateDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${policyID}`, {
selector: (selectedPolicy) => DistanceRequestUtils.getDefaultMileageRate(selectedPolicy),
selector: mileageRateSelector,
canBeMissing: true,
});
const [defaultMileageRateReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {
selector: (selectedPolicy) => DistanceRequestUtils.getDefaultMileageRate(selectedPolicy),
selector: mileageRateSelector,
canBeMissing: true,
});
const [policyCategoriesDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES_DRAFT}${policyID}`, {canBeMissing: true});
Expand Down
6 changes: 5 additions & 1 deletion src/components/PriorityModeController.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {useNavigation} from '@react-navigation/native';
import {accountIDSelector} from '@selectors/Session';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import type {OnyxEntry} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import useOnyx from '@hooks/useOnyx';
import {updateChatPriorityMode} from '@libs/actions/User';
import getIsNarrowLayout from '@libs/getIsNarrowLayout';
Expand All @@ -13,6 +15,8 @@ import SCREENS from '@src/SCREENS';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
import FocusModeNotification from './FocusModeNotification';

const isInFocusModeSelector = (priorityMode: OnyxEntry<ValueOf<typeof CONST.PRIORITY_MODE>>) => priorityMode === CONST.PRIORITY_MODE.GSD;

/**
* This component is used to automatically switch a user into #focus mode when they exceed a certain number of reports.
* We do this primarily for performance reasons. Similar to the "Welcome action" we must wait for a number of things to
Expand All @@ -27,7 +31,7 @@ import FocusModeNotification from './FocusModeNotification';
export default function PriorityModeController() {
const [accountID] = useOnyx(ONYXKEYS.SESSION, {selector: accountIDSelector, canBeMissing: true});
const [isLoadingReportData] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA, {canBeMissing: true});
const [isInFocusMode, isInFocusModeMetadata] = useOnyx(ONYXKEYS.NVP_PRIORITY_MODE, {selector: (priorityMode) => priorityMode === CONST.PRIORITY_MODE.GSD, canBeMissing: true});
const [isInFocusMode, isInFocusModeMetadata] = useOnyx(ONYXKEYS.NVP_PRIORITY_MODE, {selector: isInFocusModeSelector, canBeMissing: true});
const [hasTriedFocusMode, hasTriedFocusModeMetadata] = useOnyx(ONYXKEYS.NVP_TRY_FOCUS_MODE, {canBeMissing: true});
const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {canBeMissing: true});
const currentRouteName = useCurrentRouteName();
Expand Down
3 changes: 2 additions & 1 deletion src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {activePolicySelector} from '@selectors/Policy';
import {Str} from 'expensify-common';
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {View} from 'react-native';
Expand Down Expand Up @@ -146,7 +147,7 @@ function MoneyRequestView({
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: true});
const [activePolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${activePolicyID}`, {
canBeMissing: true,
selector: (policy) => (policy?.type !== CONST.POLICY.TYPE.PERSONAL ? policy : undefined),
selector: activePolicySelector,
});
// If the expense is unreported the policy should be the user's default policy, otherwise it should be the policy the expense was made for
const policy = isExpenseUnreported ? activePolicy : expensePolicy;
Expand Down
20 changes: 16 additions & 4 deletions src/hooks/useDefaultFundID.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import {useCallback} from 'react';
import type {OnyxCollection} from 'react-native-onyx';
import {getFundIdFromSettingsKey} from '@libs/CardUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {ExpensifyCardSettings} from '@src/types/onyx';
import useOnyx from './useOnyx';
import useWorkspaceAccountID from './useWorkspaceAccountID';

Expand All @@ -13,17 +16,26 @@ function useDefaultFundID(policyID: string | undefined) {
const [lastSelectedExpensifyCardFeed] = useOnyx(`${ONYXKEYS.COLLECTION.LAST_SELECTED_EXPENSIFY_CARD_FEED}${policyID}`, {canBeMissing: true});
const [lastSelectedCardSettings] = useOnyx(`${ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS}${lastSelectedExpensifyCardFeed}`, {canBeMissing: true});

const [domainFundID] = useOnyx(ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS, {
selector: (cardSettings) => {
const getDomainFundID = useCallback(
(cardSettings: OnyxCollection<ExpensifyCardSettings>) => {
const matchingKey = Object.entries(cardSettings ?? {}).find(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
([key, settings]) => settings?.preferredPolicy && settings.preferredPolicy === policyID && !key.includes(workspaceAccountID.toString()),
);

return getFundIdFromSettingsKey(matchingKey?.[0] ?? '');
},
canBeMissing: true,
});
[policyID, workspaceAccountID],
);

const [domainFundID] = useOnyx(
ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS,
{
selector: getDomainFundID,
canBeMissing: true,
},
[getDomainFundID],
);

if (lastSelectedExpensifyCardFeed && lastSelectedCardSettings?.paymentBankAccountID) {
return lastSelectedExpensifyCardFeed;
Expand Down
21 changes: 17 additions & 4 deletions src/hooks/useExpensifyCardFeeds.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import {useCallback} from 'react';
import type {OnyxCollection} from 'react-native-onyx';
import ONYXKEYS from '@src/ONYXKEYS';
import type {ExpensifyCardSettings} from '@src/types/onyx';
import useOnyx from './useOnyx';
import useWorkspaceAccountID from './useWorkspaceAccountID';

function useExpensifyCardFeeds(policyID: string | undefined) {
const workspaceAccountID = useWorkspaceAccountID(policyID);
const [allExpensifyCardFeeds] = useOnyx(ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS, {
selector: (cardSettings) => {

const getAllExpensifyCardFeeds = useCallback(
(cardSettings: OnyxCollection<ExpensifyCardSettings>) => {
const matchingEntries = Object.entries(cardSettings ?? {}).filter(([key, settings]) => {
const isDomainFeed = !!(settings?.preferredPolicy && settings.preferredPolicy === policyID);
const isWorkspaceFeed = key.includes(workspaceAccountID.toString()) && settings && Object.keys(settings).length > 1;
Expand All @@ -14,8 +18,17 @@ function useExpensifyCardFeeds(policyID: string | undefined) {

return Object.fromEntries(matchingEntries);
},
canBeMissing: true,
});
[policyID, workspaceAccountID],
);

const [allExpensifyCardFeeds] = useOnyx(
ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS,
{
selector: getAllExpensifyCardFeeds,
canBeMissing: true,
},
[getAllExpensifyCardFeeds],
);

return allExpensifyCardFeeds;
}
Expand Down
8 changes: 5 additions & 3 deletions src/hooks/useSearchTypeMenuSections.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {createPoliciesSelector} from '@selectors/Policy';
import {useMemo} from 'react';
import type {OnyxEntry} from 'react-native-onyx';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import {createTypeMenuSections} from '@libs/SearchUIUtils';
import ONYXKEYS from '@src/ONYXKEYS';
import type {Policy, Session} from '@src/types/onyx';
import mapOnyxCollectionItems from '@src/utils/mapOnyxCollectionItems';
import useCardFeedsForDisplay from './useCardFeedsForDisplay';
import useNetwork from './useNetwork';
import useOnyx from './useOnyx';
Expand All @@ -28,6 +28,8 @@ const policySelector = (policy: OnyxEntry<Policy>): OnyxEntry<Policy> =>
achAccount: policy.achAccount,
};

const policiesSelector = (policies: OnyxCollection<Policy>) => createPoliciesSelector(policies, policySelector);

const currentUserLoginAndAccountIDSelector = (session: OnyxEntry<Session>) => ({
email: session?.email,
accountID: session?.accountID,
Expand All @@ -40,7 +42,7 @@ const useSearchTypeMenuSections = () => {
const {defaultCardFeed, cardFeedsByPolicy} = useCardFeedsForDisplay();

const {isOffline} = useNetwork();
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: (policies) => mapOnyxCollectionItems(policies, policySelector), canBeMissing: true});
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: policiesSelector, canBeMissing: true});
const [currentUserLoginAndAccountID] = useOnyx(ONYXKEYS.SESSION, {selector: currentUserLoginAndAccountIDSelector, canBeMissing: false});
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: true});
const [savedSearches] = useOnyx(ONYXKEYS.SAVED_SEARCHES, {canBeMissing: true});
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useSidebarOrderedReports.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import reportsSelector from '@selectors/Attributes';
import {createPoliciesSelector} from '@selectors/Policy';
import {deepEqual} from 'fast-equals';
import React, {createContext, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
Expand All @@ -8,7 +9,6 @@ import SidebarUtils from '@libs/SidebarUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type * as OnyxTypes from '@src/types/onyx';
import mapOnyxCollectionItems from '@src/utils/mapOnyxCollectionItems';
import useCurrentReportID from './useCurrentReportID';
import useCurrentUserPersonalDetails from './useCurrentUserPersonalDetails';
import useDeepCompareRef from './useDeepCompareRef';
Expand Down Expand Up @@ -50,7 +50,7 @@ const policySelector = (policy: OnyxEntry<OnyxTypes.Policy>): PartialPolicyForSi
employeeList: policy.employeeList,
}) as PartialPolicyForSidebar;

const policiesSelector = (policies: OnyxCollection<OnyxTypes.Policy>) => mapOnyxCollectionItems(policies, policySelector);
const policiesSelector = (policies: OnyxCollection<OnyxTypes.Policy>) => createPoliciesSelector(policies, policySelector);

function SidebarOrderedReportsContextProvider({
children,
Expand Down
6 changes: 5 additions & 1 deletion src/hooks/useWorkspaceAccountID.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import type {OnyxEntry} from 'react-native-onyx';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {Policy} from '@src/types/onyx';
import useOnyx from './useOnyx';

const policyWorkspaceAccountIDSelector = (policy: OnyxEntry<Policy>) => policy?.workspaceAccountID;

function useWorkspaceAccountID(policyID: string | undefined) {
const [workspaceAccountID = CONST.DEFAULT_NUMBER_ID] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {selector: (policy) => policy?.workspaceAccountID});
const [workspaceAccountID = CONST.DEFAULT_NUMBER_ID] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {selector: policyWorkspaceAccountIDSelector, canBeMissing: true});

return workspaceAccountID;
}
Expand Down
6 changes: 5 additions & 1 deletion src/pages/Debug/DebugTagPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, {useCallback, useMemo, useState} from 'react';
import {View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import Button from '@components/Button';
import type {ListItem} from '@components/SelectionList/types';
import TagPicker from '@components/TagPicker';
Expand All @@ -11,6 +12,7 @@ import {insertTagIntoTransactionTagsString} from '@libs/IOUUtils';
import {getTagLists} from '@libs/PolicyUtils';
import {getTagArrayFromName} from '@libs/TransactionUtils';
import ONYXKEYS from '@src/ONYXKEYS';
import type {Policy} from '@src/types/onyx';

type DebugTagPickerProps = {
/** The policyID we are getting tags for */
Expand All @@ -23,6 +25,8 @@ type DebugTagPickerProps = {
onSubmit: (item: ListItem) => void;
};

const policyHasMultipleTagListsSelector = (policy: OnyxEntry<Policy>) => policy?.hasMultipleTagLists;

function DebugTagPicker({policyID, tagName = '', onSubmit}: DebugTagPickerProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
Expand All @@ -31,7 +35,7 @@ function DebugTagPicker({policyID, tagName = '', onSubmit}: DebugTagPickerProps)
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`, {canBeMissing: true});
const policyTagLists = useMemo(() => getTagLists(policyTags), [policyTags]);

const [hasMultipleTagLists] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {canBeMissing: true, selector: (policy) => policy?.hasMultipleTagLists});
const [hasMultipleTagLists] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {canBeMissing: true, selector: policyHasMultipleTagListsSelector});
const updateTagName = useCallback(
(index: number) =>
({text}: ListItem) => {
Expand Down
23 changes: 18 additions & 5 deletions src/pages/Search/EmptySearchView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useMemo, useRef, useState} from 'react';
import React, {useCallback, useMemo, useRef, useState} from 'react';
// eslint-disable-next-line no-restricted-imports
import type {GestureResponderEvent, ImageStyle, Text as RNText, TextStyle, ViewStyle} from 'react-native';
import {Linking, View} from 'react-native';
Expand Down Expand Up @@ -93,10 +93,7 @@ function EmptySearchView({similarSearchHash, type, groupBy, hasResults}: EmptySe
const {typeMenuSections} = useSearchTypeMenuSections();

const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: false});
const [isUserPaidPolicyMember = false] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {
canBeMissing: true,
selector: (policies) => Object.values(policies ?? {}).some((policy) => isPaidGroupPolicy(policy) && isPolicyMember(policy, currentUserPersonalDetails.login)),
});

const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: true});
const [activePolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${activePolicyID}`, {canBeMissing: true});

Expand All @@ -108,6 +105,22 @@ function EmptySearchView({similarSearchHash, type, groupBy, hasResults}: EmptySe
canBeMissing: true,
});

const isUserPaidPolicyMemberSelector = useCallback(
(policies: OnyxCollection<Policy>) => {
return Object.values(policies ?? {}).some((policy) => isPaidGroupPolicy(policy) && isPolicyMember(policy, currentUserPersonalDetails.login));
},
[currentUserPersonalDetails.login],
);

const [isUserPaidPolicyMember = false] = useOnyx(
ONYXKEYS.COLLECTION.POLICY,
{
canBeMissing: true,
selector: isUserPaidPolicyMemberSelector,
},
[isUserPaidPolicyMemberSelector],
);

return (
<SearchScopeProvider>
<EmptySearchViewContent
Expand Down
6 changes: 4 additions & 2 deletions src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {useIsFocused} from '@react-navigation/native';
import {createPoliciesSelector} from '@selectors/Policy';
import {Str} from 'expensify-common';
import type {ImageContentFit} from 'expo-image';
import type {ForwardedRef} from 'react';
Expand Down Expand Up @@ -57,7 +58,6 @@ import ROUTES from '@src/ROUTES';
import type * as OnyxTypes from '@src/types/onyx';
import type {QuickActionName} from '@src/types/onyx/QuickAction';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import mapOnyxCollectionItems from '@src/utils/mapOnyxCollectionItems';

type PolicySelector = Pick<OnyxTypes.Policy, 'type' | 'role' | 'isPolicyExpenseChatEnabled' | 'pendingAction' | 'avatarURL' | 'name' | 'id' | 'areInvoicesEnabled'>;

Expand Down Expand Up @@ -88,6 +88,8 @@ const policySelector = (policy: OnyxEntry<OnyxTypes.Policy>): PolicySelector =>
areInvoicesEnabled: policy.areInvoicesEnabled,
}) as PolicySelector;

const policiesSelector = (policies: OnyxCollection<OnyxTypes.Policy>) => createPoliciesSelector(policies, policySelector);

const sessionSelector = (session: OnyxEntry<OnyxTypes.Session>) => ({email: session?.email, accountID: session?.accountID});

const accountPrimaryLoginSelector = (account: OnyxEntry<OnyxTypes.Account>) => account?.primaryLogin;
Expand Down Expand Up @@ -117,7 +119,7 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu, ref
return policyChatsForActivePolicy.length > 0 ? policyChatsForActivePolicy.at(0) : ({} as OnyxTypes.Report);
}, [activePolicy, activePolicyID, session?.accountID, allReports]);
const [quickActionPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${quickActionReport?.policyID}`, {canBeMissing: true});
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: (c) => mapOnyxCollectionItems(c, policySelector), canBeMissing: true});
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: policiesSelector, canBeMissing: true});
const [lastDistanceExpenseType] = useOnyx(ONYXKEYS.NVP_LAST_DISTANCE_EXPENSE_TYPE, {canBeMissing: true});
const currentUserPersonalDetails = useCurrentUserPersonalDetails();
const {isDelegateAccessRestricted, showDelegateNoAccessModal} = useContext(DelegateNoAccessContext);
Expand Down
10 changes: 8 additions & 2 deletions src/pages/iou/request/step/IOURequestEditReportCommon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import {createPoliciesSelector} from '@selectors/Policy';
import React, {useMemo} from 'react';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import * as Expensicons from '@components/Icon/Expensicons';
import MenuItem from '@components/MenuItem';
import {useOptionsList} from '@components/OptionListContextProvider';
Expand All @@ -17,8 +19,8 @@ import {getOutstandingReportsForUser, getPolicyName, isIOUReport, isOpenReport,
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {Route} from '@src/ROUTES';
import type {Policy} from '@src/types/onyx';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import mapOnyxCollectionItems from '@src/utils/mapOnyxCollectionItems';
import StepScreenWrapper from './StepScreenWrapper';

type TransactionGroupListItem = ListItem & {
Expand All @@ -38,6 +40,10 @@ type Props = {
shouldShowNotFoundPage?: boolean;
};

const policyIdSelector = (policy: OnyxEntry<Policy>) => policy?.id;

const policiesSelector = (policies: OnyxCollection<Policy>) => createPoliciesSelector(policies, policyIdSelector);

function IOURequestEditReportCommon({
backTo,
transactionIDs,
Expand All @@ -57,7 +63,7 @@ function IOURequestEditReportCommon({
const reportOwnerAccountID = useMemo(() => selectedReport?.ownerAccountID ?? currentUserPersonalDetails.accountID, [selectedReport, currentUserPersonalDetails.accountID]);
const reportPolicy = usePolicy(selectedReport?.policyID);
const [reportNameValuePairs] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS, {canBeMissing: true});
const [allPoliciesID] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: (policies) => mapOnyxCollectionItems(policies, (policy) => policy?.id), canBeMissing: false});
const [allPoliciesID] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: policiesSelector, canBeMissing: false});

const [searchValue, debouncedSearchValue, setSearchValue] = useDebouncedState('');
const isOwner = selectedReport ? selectedReport.ownerAccountID === currentUserPersonalDetails.accountID : false;
Expand Down
3 changes: 2 additions & 1 deletion src/pages/iou/request/step/IOURequestStepCategory.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {activePolicySelector} from '@selectors/Policy';
import lodashIsEmpty from 'lodash/isEmpty';
import React, {useEffect} from 'react';
import {InteractionManager, View} from 'react-native';
Expand Down Expand Up @@ -55,7 +56,7 @@ function IOURequestStepCategory({
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: true});
const [activePolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${activePolicyID}`, {
canBeMissing: true,
selector: (policy) => (policy?.type !== CONST.POLICY.TYPE.PERSONAL ? policy : undefined),
selector: activePolicySelector,
});
const isExpenseUnreported = isExpenseUnreportedTransactionUtils(transaction);
const policy = isExpenseUnreported ? activePolicy : (policyReal ?? policyDraft);
Expand Down
Loading