Skip to content

Commit

Permalink
Merge pull request #36470 from cubuspl42/fix-request-money-crash
Browse files Browse the repository at this point in the history
Fix a crash when requesting money

(cherry picked from commit 63733d8)
  • Loading branch information
pecanoro authored and OSBotify committed Feb 14, 2024
1 parent fc7373f commit 95a906a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
const isMerchantEmpty = !iouMerchant || iouMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;
const isMerchantRequired = isPolicyExpenseChat && !isScanRequest && shouldShowMerchant;

const isCategoryRequired = canUseViolations && Boolean(policy.requiresCategory);
const isTagRequired = canUseViolations && Boolean(policy.requiresTag);
const isCategoryRequired = canUseViolations && lodashGet(policy, 'requiresCategory', false);
const isTagRequired = canUseViolations && lodashGet(policy, 'requiresTag', false);

useEffect(() => {
if ((!isMerchantRequired && isMerchantEmpty) || !merchantError) {
Expand Down Expand Up @@ -761,7 +761,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
titleStyle={styles.flex1}
disabled={didConfirm}
interactive={!isReadOnly}
rightLabel={canUseViolations && Boolean(policy.requiresCategory) ? translate('common.required') : ''}
rightLabel={isCategoryRequired ? translate('common.required') : ''}
/>
),
shouldShow: shouldShowCategories,
Expand All @@ -783,7 +783,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
style={[styles.moneyRequestMenuItem]}
disabled={didConfirm}
interactive={!isReadOnly}
rightLabel={canUseViolations && lodashGet(policy, 'requiresTag', false) ? translate('common.required') : ''}
rightLabel={isTagRequired ? translate('common.required') : ''}
/>
),
shouldShow: shouldShowTags,
Expand Down

0 comments on commit 95a906a

Please sign in to comment.