Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/components/AttachmentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,11 @@ function AttachmentModal({
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, [isReceiptAttachment, transaction, file, sourceState, iouType]);

// There are a few things that shouldn't be set until we absolutely know if the file is a receipt or an attachment.
// props.isReceiptAttachment will be null until its certain what the file is, in which case it will then be true|false.
let headerTitleNew = headerTitle;
const headerTitleNew = headerTitle ?? translate(isReceiptAttachment ? 'common.receipt' : 'common.attachment');
const shouldShowThreeDotsButton = isReceiptAttachment && isModalOpen && threeDotsMenuItems.length !== 0;
let shouldShowDownloadButton = false;
let shouldShowThreeDotsButton = false;
if (!isEmptyObject(report) || type === CONST.ATTACHMENT_TYPE.SEARCH) {
headerTitleNew = translate(isReceiptAttachment ? 'common.receipt' : 'common.attachment');
shouldShowDownloadButton = allowDownload && isDownloadButtonReadyToBeShown && !shouldShowNotFoundPage && !isReceiptAttachment && !isOffline && !isLocalSource;
shouldShowThreeDotsButton = isReceiptAttachment && isModalOpen && threeDotsMenuItems.length !== 0;
}
const context = useMemo(
() => ({
Expand Down