diff --git a/src/components/MoneyRequestConfirmationList.tsx b/src/components/MoneyRequestConfirmationList.tsx index b2dac85f70eb..038d864c4c10 100755 --- a/src/components/MoneyRequestConfirmationList.tsx +++ b/src/components/MoneyRequestConfirmationList.tsx @@ -340,7 +340,7 @@ function MoneyRequestConfirmationList({ const shouldDisplayMerchantError = isMerchantRequired && (shouldDisplayFieldError || formError === 'iou.error.invalidMerchant') && isMerchantEmpty; - const isCategoryRequired = canUseViolations && !!policy?.requiresCategory; + const isCategoryRequired = !!policy?.requiresCategory; useEffect(() => { if (shouldDisplayFieldError && hasSmartScanFailed) { @@ -545,7 +545,7 @@ function MoneyRequestConfirmationList({ let updatedTagsString = TransactionUtils.getTag(transaction); policyTagLists.forEach((tagList, index) => { const enabledTags = Object.values(tagList.tags).filter((tag) => tag.enabled); - const isTagListRequired = tagList.required === undefined ? false : tagList.required && canUseViolations; + const isTagListRequired = tagList.required ?? false; if (!isTagListRequired || enabledTags.length !== 1 || TransactionUtils.getTag(transaction, index)) { return; } @@ -556,7 +556,7 @@ function MoneyRequestConfirmationList({ } // Keep 'transaction' out to ensure that we autoselect the option only once // eslint-disable-next-line react-hooks/exhaustive-deps - }, [policyTagLists, policyTags, canUseViolations]); + }, [policyTagLists, policyTags]); /** */ @@ -870,14 +870,14 @@ function MoneyRequestConfirmationList({ titleStyle={styles.flex1} disabled={didConfirm} interactive={!isReadOnly} - rightLabel={isCategoryRequired ? translate('common.required') : ''} + rightLabel={isCategoryRequired && canUseViolations ? translate('common.required') : ''} /> ), shouldShow: shouldShowCategories, isSupplementary: action === CONST.IOU.ACTION.CATEGORIZE ? false : !isCategoryRequired, }, ...policyTagLists.map(({name, required}, index) => { - const isTagRequired = required === undefined ? false : canUseViolations && required; + const isTagRequired = required ?? false; return { item: ( ), shouldShow: shouldShowTags,