@@ -21,6 +21,7 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
2121import useThemeStyles from '@hooks/useThemeStyles' ;
2222import KeyboardShortcut from '@libs/KeyboardShortcut' ;
2323import { getOriginalMessage , getReportAction , isMoneyRequestAction } from '@libs/ReportActionsUtils' ;
24+ import { hasEReceipt , hasReceiptSource } from '@libs/TransactionUtils' ;
2425import type { AvatarSource } from '@libs/UserAvatarUtils' ;
2526import variables from '@styles/variables' ;
2627import CONST from '@src/CONST' ;
@@ -185,14 +186,15 @@ function AttachmentModalBaseContent({
185186 } , [ clearAttachmentErrors ] ) ;
186187
187188 const { isAttachmentLoaded} = useContext ( AttachmentStateContext ) ;
189+ const isEReceipt = transaction && ! hasReceiptSource ( transaction ) && hasEReceipt ( transaction ) ;
188190 const shouldShowDownloadButton = useMemo ( ( ) => {
189191 const isValidContext = ! isEmptyObject ( report ) || type === CONST . ATTACHMENT_TYPE . SEARCH ;
190- if ( ! isValidContext || isErrorInAttachment ( source ) ) {
192+ if ( ! isValidContext || isErrorInAttachment ( source ) || isEReceipt ) {
191193 return false ;
192194 }
193195
194196 return ! ! onDownloadAttachment && isDownloadButtonReadyToBeShown && ! shouldShowNotFoundPage && ! isOffline && ! isLocalSource && isAttachmentLoaded ?.( source ) ;
195- } , [ isAttachmentLoaded , isDownloadButtonReadyToBeShown , isErrorInAttachment , isLocalSource , isOffline , onDownloadAttachment , report , shouldShowNotFoundPage , source , type ] ) ;
197+ } , [ isAttachmentLoaded , isDownloadButtonReadyToBeShown , isErrorInAttachment , isLocalSource , isOffline , onDownloadAttachment , report , shouldShowNotFoundPage , source , type , isEReceipt ] ) ;
196198
197199 // We need to pass a shared value of type boolean to the context, so `falseSV` acts as a default value.
198200 const falseSV = useSharedValue ( false ) ;
0 commit comments