Allow download of view once images if received in-call

This commit is contained in:
Josh Perez 2021-07-19 17:48:07 -04:00 committed by GitHub
parent b392b7c7ee
commit aade43bfa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 9 deletions

View File

@ -2057,6 +2057,16 @@ export class Message extends React.Component<Props, State> {
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<Props, State> {
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);
};