Skip to content

Commit

Permalink
Hide download receipt button when offline
Browse files Browse the repository at this point in the history
  • Loading branch information
abzokhattab committed Jan 8, 2024
1 parent 5cb22df commit be6aba7
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 @@ -387,11 +387,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 @@ -413,7 +415,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 be6aba7

Please sign in to comment.