Skip to content

Commit

Permalink
Merge pull request #31420 from parasharrajat/small-fix
Browse files Browse the repository at this point in the history
[CP staging]Import Permissions lib and fix App crash

(cherry picked from commit 2b4909d)
  • Loading branch information
MonilBhavsar authored and OSBotify committed Nov 16, 2023
1 parent 22af3b7 commit cd47745
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/ReportActionItem/MoneyRequestView.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Text from '@components/Text';
import transactionPropTypes from '@components/transactionPropTypes';
import withCurrentUserPersonalDetails, {withCurrentUserPersonalDetailsPropTypes} from '@components/withCurrentUserPersonalDetails';
import useLocalize from '@hooks/useLocalize';
import usePermissions from '@hooks/usePermissions';
import useWindowDimensions from '@hooks/useWindowDimensions';
import * as CardUtils from '@libs/CardUtils';
import compose from '@libs/compose';
Expand Down Expand Up @@ -76,6 +77,7 @@ const defaultProps = {
function MoneyRequestView({report, parentReport, policyCategories, shouldShowHorizontalRule, transaction, policyTags, policy}) {
const {isSmallScreenWidth} = useWindowDimensions();
const {translate} = useLocalize();
const {canUseViolations} = usePermissions();
const parentReportAction = ReportActionsUtils.getParentReportAction(report);
const moneyRequestReport = parentReport;
const {
Expand Down Expand Up @@ -173,7 +175,7 @@ function MoneyRequestView({report, parentReport, policyCategories, shouldShowHor
</View>
</OfflineWithFeedback>
)}
{!hasReceipt && canEdit && !isSettled && Permissions.canUseViolations() && (
{!hasReceipt && canEdit && !isSettled && canUseViolations && (
<ReceiptEmptyState
hasError={hasErrors}
onPress={() => Navigation.navigate(ROUTES.EDIT_REQUEST.getRoute(report.reportID, CONST.EDIT_REQUEST_FIELD.RECEIPT))}
Expand Down

0 comments on commit cd47745

Please sign in to comment.