From 41d71ab48799051b784c51bbff962f0a19a176e1 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Thu, 9 Nov 2023 17:21:45 +0200 Subject: [PATCH 1/2] Move View wrapper to AttachmentViewPdf --- src/components/AttachmentModal.js | 26 +++++++-------- .../Attachments/AttachmentView/index.js | 33 +++++++++++-------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index 8fcf765ef7c5..78758324d5e3 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -443,21 +443,17 @@ function AttachmentModal(props) { ) : ( Boolean(sourceForAttachmentView) && shouldLoadAttachment && ( - // We need the following View component on android native - // So that the event will propagate properly and - // the Password protected preview will be shown for pdf attachement we are about to send. - - - + + ) )} diff --git a/src/components/Attachments/AttachmentView/index.js b/src/components/Attachments/AttachmentView/index.js index 98086dcc4a0c..de8c0fff45e8 100755 --- a/src/components/Attachments/AttachmentView/index.js +++ b/src/components/Attachments/AttachmentView/index.js @@ -122,21 +122,26 @@ function AttachmentView({ if ((_.isString(source) && Str.isPDF(source)) || (file && Str.isPDF(file.name || translate('attachmentView.unknownFilename')))) { const encryptedSourceUrl = isAuthTokenRequired ? addEncryptedAuthTokenToURL(source) : source; + // We need the following View component on android native + // So that the event will propagate properly and + // the Password protected preview will be shown for pdf attachement we are about to send. return ( - !loadComplete && setLoadComplete(true)} - errorLabelStyles={isUsedInAttachmentModal ? [styles.textLabel, styles.textLarge] : [cursor.cursorAuto]} - style={isUsedInAttachmentModal ? styles.imageModalPDF : styles.flex1} - /> + + !loadComplete && setLoadComplete(true)} + errorLabelStyles={isUsedInAttachmentModal ? [styles.textLabel, styles.textLarge] : [cursor.cursorAuto]} + style={isUsedInAttachmentModal ? styles.imageModalPDF : styles.flex1} + /> + ); } From 595bb78bd84a9fa1bf936a8459f85cb379d2ea07 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Thu, 9 Nov 2023 17:29:02 +0200 Subject: [PATCH 2/2] ... you saw nothing ... --- src/components/AttachmentModal.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index 78758324d5e3..8231dd7c4fe2 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -453,7 +453,6 @@ function AttachmentModal(props) { fallbackSource={props.fallbackSource} isUsedInAttachmentModal /> - ) )}