Skip to content

Commit

Permalink
Use vilations at requried places
Browse files Browse the repository at this point in the history
  • Loading branch information
allgandalf committed May 7, 2024
1 parent b507d60 commit c289d78
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/MoneyRequestConfirmationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

/**
*/
Expand Down Expand Up @@ -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: (
<MenuItemWithTopDescription
Expand All @@ -894,7 +894,7 @@ function MoneyRequestConfirmationList({
style={[styles.moneyRequestMenuItem]}
disabled={didConfirm}
interactive={!isReadOnly}
rightLabel={isTagRequired ? translate('common.required') : ''}
rightLabel={isTagRequired && canUseViolations ? translate('common.required') : ''}
/>
),
shouldShow: shouldShowTags,
Expand Down

0 comments on commit c289d78

Please sign in to comment.