Skip to content

Commit

Permalink
Merge pull request Expensify#33273 from bernhardoj/fix/32923-hide-add…
Browse files Browse the repository at this point in the history
…-receipt-placeholder

Hide add receipt placeholder if the user isn't allowed add a receipt
  • Loading branch information
Joel Bettner authored Dec 21, 2023
2 parents c01f183 + f2b74e8 commit 9d71a22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/ReportActionItem/MoneyRequestView.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ function MoneyRequestView({report, parentReport, parentReportActions, policyCate
const isCancelled = moneyRequestReport && moneyRequestReport.isCancelledIOU;
const canEdit = ReportUtils.canEditMoneyRequest(parentReportAction);
const canEditAmount = canEdit && !isSettled && !isCardTransaction;
const canEditReceipt = ReportUtils.canEditFieldOfMoneyRequest(parentReportAction, moneyRequestReport.reportID, CONST.EDIT_REQUEST_FIELD.RECEIPT);

// 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]);
Expand Down Expand Up @@ -191,7 +192,7 @@ function MoneyRequestView({report, parentReport, parentReportActions, policyCate
</View>
</OfflineWithFeedback>
)}
{!hasReceipt && canEdit && !isSettled && canUseViolations && (
{!hasReceipt && canEditReceipt && !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 9d71a22

Please sign in to comment.