diff --git a/src/components/MoneyRequestHeaderSecondaryActions.tsx b/src/components/MoneyRequestHeaderSecondaryActions.tsx index cb81dd69f6aa..4d0ce7c2e739 100644 --- a/src/components/MoneyRequestHeaderSecondaryActions.tsx +++ b/src/components/MoneyRequestHeaderSecondaryActions.tsx @@ -359,7 +359,7 @@ function MoneyRequestHeaderSecondaryActions({reportID, onBackButtonPress}: Money iconFill: isDuplicateActive ? undefined : theme.icon, value: CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.DUPLICATE, onSelected: () => { - if (defaultExpensePolicy && shouldRestrictUserBillableActions(defaultExpensePolicy.id, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed)) { + if (defaultExpensePolicy && shouldRestrictUserBillableActions(defaultExpensePolicy, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed)) { dropdownMenuRef.current?.setIsMenuVisible(false); Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(defaultExpensePolicy.id)); return; diff --git a/src/hooks/useExpenseActions.ts b/src/hooks/useExpenseActions.ts index ebf4d214d461..132028c047e0 100644 --- a/src/hooks/useExpenseActions.ts +++ b/src/hooks/useExpenseActions.ts @@ -322,7 +322,7 @@ function useExpenseActions({reportID, isReportInSearch = false, backTo, onDuplic iconFill: isDuplicateActive ? undefined : theme.icon, value: CONST.REPORT.SECONDARY_ACTIONS.DUPLICATE_EXPENSE, onSelected: () => { - if (defaultExpensePolicy && shouldRestrictUserBillableActions(defaultExpensePolicy.id, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed)) { + if (defaultExpensePolicy && shouldRestrictUserBillableActions(defaultExpensePolicy, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed)) { onDuplicateReset?.(); Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(defaultExpensePolicy.id)); return; @@ -383,7 +383,7 @@ function useExpenseActions({reportID, isReportInSearch = false, backTo, onDuplic const isSourcePolicyValid = !!policy && isPolicyAccessible(policy, currentUserLogin ?? ''); const targetPolicyForDuplicate = isSourcePolicyValid ? policy : defaultExpensePolicy; - if (targetPolicyForDuplicate && shouldRestrictUserBillableActions(targetPolicyForDuplicate.id, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed)) { + if (targetPolicyForDuplicate && shouldRestrictUserBillableActions(targetPolicyForDuplicate, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed)) { onDuplicateReset?.(); Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(targetPolicyForDuplicate.id)); return; diff --git a/src/hooks/useSearchBulkActions.ts b/src/hooks/useSearchBulkActions.ts index 93775f43c2e5..8bcf2b9def2f 100644 --- a/src/hooks/useSearchBulkActions.ts +++ b/src/hooks/useSearchBulkActions.ts @@ -1,3 +1,4 @@ +/* eslint-disable react-hooks/refs */ import {useCallback, useEffect, useMemo, useRef, useState} from 'react'; // eslint-disable-next-line no-restricted-imports import {InteractionManager} from 'react-native'; @@ -1134,7 +1135,7 @@ function useSearchBulkActions({queryJSON}: UseSearchBulkActionsParams) { value: CONST.SEARCH.BULK_ACTION_TYPES.DUPLICATE, shouldCloseModalOnSelect: true, onSelected: () => { - if (defaultExpensePolicy && shouldRestrictUserBillableActions(defaultExpensePolicy.id, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed)) { + if (defaultExpensePolicy && shouldRestrictUserBillableActions(defaultExpensePolicy, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(defaultExpensePolicy.id)); return; } @@ -1483,7 +1484,7 @@ function useSearchBulkActions({queryJSON}: UseSearchBulkActionsParams) { value: CONST.SEARCH.BULK_ACTION_TYPES.DUPLICATE, shouldCloseModalOnSelect: true, onSelected: () => { - if (defaultExpensePolicy && shouldRestrictUserBillableActions(defaultExpensePolicy.id, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed)) { + if (defaultExpensePolicy && shouldRestrictUserBillableActions(defaultExpensePolicy, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed)) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(defaultExpensePolicy.id)); return; }