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
6 changes: 6 additions & 0 deletions src/pages/workspace/rules/MerchantRulesSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import Section from '@components/Section';
import Text from '@components/Text';
import useEnvironment from '@hooks/useEnvironment';
import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import usePolicy from '@hooks/usePolicy';
Expand Down Expand Up @@ -70,6 +71,7 @@ function MerchantRulesSection({policyID}: MerchantRulesSectionProps) {
const theme = useTheme();
const policy = usePolicy(policyID);
const expensifyIcons = useMemoizedLazyExpensifyIcons(['Plus']);
const {isProduction} = useEnvironment();

// Hoist iterator-independent translations to avoid redundant calls in the loop
const fieldLabels: FieldLabels = useMemo(
Expand Down Expand Up @@ -101,6 +103,10 @@ function MerchantRulesSection({policyID}: MerchantRulesSectionProps) {
});
}, [codingRules]);

if (isProduction) {
return null;
Comment on lines +106 to +107

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Disable merchant-rule screens in production

This change only removes the MerchantRulesSection entry point in production, but it does not actually disable the merchant-rule flow: the screens are still registered in src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx (e.g., SCREENS.WORKSPACE.RULES_MERCHANT_NEW / ...EDIT), and MerchantRulePageBase has no production guard. In production, anyone with a bookmarked/deep-linked merchant-rule URL can still open create/edit pages and submit rules, so the revert is incomplete.

Useful? React with 👍 / 👎.

}

const renderTitle = () => (
<View style={[styles.flexRow, styles.alignItemsCenter, styles.gap1]}>
<Text style={[styles.textHeadline, styles.cardSectionTitle, styles.accountSettingsSectionTitle, {color: theme.text}]}>{translate('workspace.rules.merchantRules.title')}</Text>
Expand Down
Loading