Skip to content

Commit

Permalink
perform conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Sep 20, 2023
1 parent 5cdc7fb commit ce2907d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/ReportActionItem/MoneyRequestView.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, {useMemo} from 'react';
import {View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import lodashGet from 'lodash/get';
import lodashValues from 'lodash/values';
import PropTypes from 'prop-types';
import reportPropTypes from '../../pages/reportPropTypes';
import ONYXKEYS from '../../ONYXKEYS';
Expand Down Expand Up @@ -90,8 +90,7 @@ function MoneyRequestView({betas, report, parentReport, policyCategories, should
// A flag for verifying that the current report is a sub-report of a workspace chat
const isPolicyExpenseChat = useMemo(() => ReportUtils.isPolicyExpenseChat(ReportUtils.getRootParentReport(report)), [report]);
// A flag for showing categories
const shouldShowCategory =
isPolicyExpenseChat && Permissions.canUseCategories(betas) && (!_.isEmpty(transactionCategory) || OptionsListUtils.hasEnabledOptions(_.values(policyCategories)));
const shouldShowCategory = isPolicyExpenseChat && Permissions.canUseCategories(betas) && (transactionCategory || OptionsListUtils.hasEnabledOptions(lodashValues(policyCategories)));

let description = `${translate('iou.amount')}${translate('iou.cash')}`;
if (isSettled) {
Expand Down

0 comments on commit ce2907d

Please sign in to comment.