From 84367a8e0a4684745a4db0df65da12dd519608c8 Mon Sep 17 00:00:00 2001 From: Danut Gavrus Date: Wed, 17 May 2023 12:11:29 +0300 Subject: [PATCH 1/6] [FIX 17237] Updated usages of source. --- src/components/AttachmentModal.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index ea5f5baa1558..0c7fb538491c 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -250,7 +250,7 @@ class AttachmentModal extends PureComponent { } render() { - const source = this.state.source; + const source = this.props.source || this.state.source; return ( <> ) : ( - Boolean(this.state.source) && - this.state.shouldLoadAttachment && ( + Boolean(source) && this.state.shouldLoadAttachment && ( Date: Thu, 18 May 2023 13:04:40 +0300 Subject: [PATCH 2/6] [FIX 17237] Reverted usage before attachment view. --- src/components/AttachmentModal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index 0c7fb538491c..821afcb3ff62 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -286,7 +286,8 @@ class AttachmentModal extends PureComponent { onToggleKeyboard={this.updateConfirmButtonVisibility} /> ) : ( - Boolean(source) && this.state.shouldLoadAttachment && ( + Boolean(this.state.source) + && this.state.shouldLoadAttachment && ( Date: Thu, 18 May 2023 13:05:24 +0300 Subject: [PATCH 3/6] [FIX 17237] Reverted usage before attachment view. --- src/components/AttachmentModal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index 821afcb3ff62..2b291a1b46fc 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -286,8 +286,8 @@ class AttachmentModal extends PureComponent { onToggleKeyboard={this.updateConfirmButtonVisibility} /> ) : ( - Boolean(this.state.source) - && this.state.shouldLoadAttachment && ( + Boolean(this.state.source) && + this.state.shouldLoadAttachment && ( Date: Thu, 18 May 2023 15:47:37 +0300 Subject: [PATCH 4/6] [FIX 17237] Unified back all usages of source in render. --- src/components/AttachmentModal.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index 2b291a1b46fc..0c7fb538491c 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -286,8 +286,7 @@ class AttachmentModal extends PureComponent { onToggleKeyboard={this.updateConfirmButtonVisibility} /> ) : ( - Boolean(this.state.source) && - this.state.shouldLoadAttachment && ( + Boolean(source) && this.state.shouldLoadAttachment && ( Date: Thu, 18 May 2023 16:21:45 +0300 Subject: [PATCH 5/6] [FIX 17237] Downloaded image could not be opened afterwards. --- src/components/AttachmentModal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index 0c7fb538491c..b0112209f37a 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -274,7 +274,7 @@ class AttachmentModal extends PureComponent { title={this.props.headerTitle || this.props.translate('common.attachment')} shouldShowBorderBottom shouldShowDownloadButton={this.props.allowDownload} - onDownloadButtonPress={() => this.downloadAttachment(source)} + onDownloadButtonPress={() => this.downloadAttachment(this.state.source)} onCloseButtonPress={() => this.setState({isModalOpen: false})} /> @@ -282,7 +282,7 @@ class AttachmentModal extends PureComponent { ) : ( From a4a65695591dfe09c7b3f0e36c19bc0afa21fc90 Mon Sep 17 00:00:00 2001 From: Danut Gavrus Date: Mon, 22 May 2023 19:00:09 +0300 Subject: [PATCH 6/6] [FIX 17237] Run prettier. --- src/components/AttachmentModal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/AttachmentModal.js b/src/components/AttachmentModal.js index b0112209f37a..642004913303 100755 --- a/src/components/AttachmentModal.js +++ b/src/components/AttachmentModal.js @@ -286,7 +286,8 @@ class AttachmentModal extends PureComponent { onToggleKeyboard={this.updateConfirmButtonVisibility} /> ) : ( - Boolean(source) && this.state.shouldLoadAttachment && ( + Boolean(source) && + this.state.shouldLoadAttachment && (