From f0a8cdc008e361fe16dd7974058bd389240814a0 Mon Sep 17 00:00:00 2001 From: MobileMage Date: Fri, 27 Feb 2026 15:02:11 +0100 Subject: [PATCH] Check policy feature flags instead of card feeds for require company card toggle The toggle was locked because it checked for actual card feed entries which only exist after connecting a card provider. Now checks the policy's areCompanyCardsEnabled/areExpensifyCardsEnabled flags instead. --- src/pages/workspace/rules/IndividualExpenseRulesSection.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/workspace/rules/IndividualExpenseRulesSection.tsx b/src/pages/workspace/rules/IndividualExpenseRulesSection.tsx index c317b1fd7650..c734a987fa0a 100644 --- a/src/pages/workspace/rules/IndividualExpenseRulesSection.tsx +++ b/src/pages/workspace/rules/IndividualExpenseRulesSection.tsx @@ -5,7 +5,6 @@ import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import RenderHTML from '@components/RenderHTML'; import Section from '@components/Section'; -import useCardFeeds from '@hooks/useCardFeeds'; import useEnvironment from '@hooks/useEnvironment'; import useLocalize from '@hooks/useLocalize'; import useOnyx from '@hooks/useOnyx'; @@ -73,7 +72,6 @@ function IndividualExpenseRulesSection({policyID}: IndividualExpenseRulesSection const {translate} = useLocalize(); const styles = useThemeStyles(); const policy = usePolicy(policyID); - const [cardFeeds] = useCardFeeds(policyID); const {environmentURL} = useEnvironment(); const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`); @@ -211,7 +209,7 @@ function IndividualExpenseRulesSection({policyID}: IndividualExpenseRulesSection const areEReceiptsEnabled = policy?.eReceipts ?? false; const requireCompanyCardsEnabled = policy?.requireCompanyCardsEnabled ?? false; - const disableRequireCompanyCardToggle = Object.keys(cardFeeds ?? {}).length === 0; + const disableRequireCompanyCardToggle = !policy?.areCompanyCardsEnabled && !policy?.areExpensifyCardsEnabled; // For backwards compatibility with Expensify Classic, we assume that Attendee Tracking is enabled by default on // Control policies if the policy does not contain the attribute