Skip to content

Commit

Permalink
Merge pull request #34118 from abzokhattab/hide-download-receipt-butt…
Browse files Browse the repository at this point in the history
…on-when-offline

Hide download receipt button when offline
  • Loading branch information
tgolen authored Jan 11, 2024
2 parents 2a89886 + be6aba7 commit ca3c4db
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/AttachmentModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,13 @@ function AttachmentModal(props) {
},
});
}
menuItems.push({
icon: Expensicons.Download,
text: props.translate('common.download'),
onSelected: () => downloadAttachment(source),
});
if (!isOffline) {
menuItems.push({
icon: Expensicons.Download,
text: props.translate('common.download'),
onSelected: () => downloadAttachment(source),
});
}
if (TransactionUtils.hasReceipt(props.transaction) && !TransactionUtils.isReceiptBeingScanned(props.transaction) && props.canEditReceipt) {
menuItems.push({
icon: Expensicons.Trashcan,
Expand All @@ -421,7 +423,7 @@ function AttachmentModal(props) {
if (!_.isEmpty(props.report)) {
headerTitle = translate(props.isReceiptAttachment ? 'common.receipt' : 'common.attachment');
shouldShowDownloadButton = props.allowDownload && isDownloadButtonReadyToBeShown && !props.isReceiptAttachment && !isOffline;
shouldShowThreeDotsButton = props.isReceiptAttachment && isModalOpen;
shouldShowThreeDotsButton = props.isReceiptAttachment && isModalOpen && threeDotsMenuItems.length !== 0;
}

return (
Expand Down

0 comments on commit ca3c4db

Please sign in to comment.