Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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}`);

Expand Down Expand Up @@ -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
Expand Down
Loading