Skip to content

Commit 45acc86

Browse files
authored
Merge pull request #61031 from bernhardoj/fix/60092-missing-receipt-title-and-options
Fix missing title and 3-dots on receipt page
2 parents 135b129 + 55336ba commit 45acc86

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/components/AttachmentModal.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,15 +487,11 @@ function AttachmentModal({
487487
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
488488
}, [isReceiptAttachment, transaction, file, sourceState, iouType]);
489489

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

0 commit comments

Comments
 (0)