From aade43bfa3876e9ab79d259e8619f34301b8d175 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Mon, 19 Jul 2021 17:48:07 -0400 Subject: [PATCH] Allow download of view once images if received in-call --- ts/components/conversation/Message.tsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index 291cb2fee..d7aacc33f 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -2057,6 +2057,16 @@ export class Message extends React.Component { return; } + if (attachments && hasNotDownloaded(attachments[0])) { + event.preventDefault(); + event.stopPropagation(); + kickOffAttachmentDownload({ + attachment: attachments[0], + messageId: id, + }); + return; + } + if (isTapToViewExpired) { const action = direction === 'outgoing' @@ -2215,15 +2225,6 @@ export class Message extends React.Component { return; } - // If there an incomplete attachment, do not execute the default action - const { attachments } = this.props; - if (attachments && attachments.length > 0) { - const [firstAttachment] = attachments; - if (!firstAttachment.url) { - return; - } - } - this.handleOpen(event); };