From b795d4b0139ccfd54e06db710ff2c0d140c69b97 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 14 Sep 2021 13:11:26 -0300 Subject: [PATCH] [IMPROVE] Show full image when available (#3370) Co-authored-by: Gerzon Z --- app/views/AttachmentView.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/AttachmentView.js b/app/views/AttachmentView.js index c0a5fc28..a5740503 100644 --- a/app/views/AttachmentView.js +++ b/app/views/AttachmentView.js @@ -106,8 +106,10 @@ class AttachmentView extends React.Component { handleSave = async () => { const { attachment } = this.state; const { user, baseUrl } = this.props; - const { image_url, image_type, video_url, video_type } = attachment; - const url = image_url || video_url; + const { + title_link, image_url, image_type, video_url, video_type + } = attachment; + const url = title_link || image_url || video_url; const mediaAttachment = formatAttachmentUrl(url, user.id, user.token, baseUrl); if (isAndroid) { @@ -173,7 +175,7 @@ class AttachmentView extends React.Component { let content = null; if (attachment && attachment.image_url) { - const uri = formatAttachmentUrl(attachment.image_url, user.id, user.token, baseUrl); + const uri = formatAttachmentUrl(attachment.title_link || attachment.image_url, user.id, user.token, baseUrl); content = this.renderImage(encodeURI(uri)); } else if (attachment && attachment.video_url) { const uri = formatAttachmentUrl(attachment.video_url, user.id, user.token, baseUrl);