@@ -16,6 +16,7 @@ import {convertToBackendAmount, convertToFrontendAmountAsString} from '@libs/Cur
1616import Navigation from '@libs/Navigation/Navigation' ;
1717import type { PlatformStackScreenProps } from '@libs/Navigation/PlatformStackNavigation/types' ;
1818import type { SettingsNavigatorParamList } from '@libs/Navigation/types' ;
19+ import { isPolicyFeatureEnabled } from '@libs/PolicyUtils' ;
1920import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper' ;
2021import { setPolicyAutoReimbursementLimit } from '@userActions/Policy/Policy' ;
2122import CONST from '@src/CONST' ;
@@ -37,6 +38,7 @@ function RulesAutoPayReportsUnderPage({route}: RulesAutoPayReportsUnderPageProps
3738 const currency = policy ?. outputCurrency ?? CONST . CURRENCY . USD ;
3839 const currencySymbol = getCurrencySymbol ( currency ) ;
3940 const autoPayApprovedReportsUnavailable = policy ?. reimbursementChoice === CONST . POLICY . REIMBURSEMENT_CHOICES . REIMBURSEMENT_NO ;
41+ const isWorkflowsEnabled = isPolicyFeatureEnabled ( policy , CONST . POLICY . MORE_FEATURES . ARE_WORKFLOWS_ENABLED ) ;
4042 const defaultValue = convertToFrontendAmountAsString ( policy ?. autoReimbursement ?. limit ?? CONST . POLICY . AUTO_REIMBURSEMENT_LIMIT_DEFAULT_CENTS , policy ?. outputCurrency ) ;
4143
4244 const validateLimit = ( { maxExpenseAutoPayAmount} : FormOnyxValues < typeof ONYXKEYS . FORMS . RULES_AUTO_PAY_REPORTS_UNDER_MODAL_FORM > ) => {
@@ -52,7 +54,7 @@ function RulesAutoPayReportsUnderPage({route}: RulesAutoPayReportsUnderPageProps
5254 policyID = { policyID }
5355 accessVariants = { [ CONST . POLICY . ACCESS_VARIANTS . ADMIN , CONST . POLICY . ACCESS_VARIANTS . PAID ] }
5456 featureName = { CONST . POLICY . MORE_FEATURES . ARE_WORKFLOWS_ENABLED }
55- shouldBeBlocked = { ! policy ?. shouldShowAutoReimbursementLimitOption || autoPayApprovedReportsUnavailable }
57+ shouldBeBlocked = { isWorkflowsEnabled && ( ! policy ?. shouldShowAutoReimbursementLimitOption || autoPayApprovedReportsUnavailable ) }
5658 >
5759 < ScreenWrapper
5860 enableEdgeToEdgeBottomSafeAreaPadding
0 commit comments