Ensure non-visual attachments can be manually downloaded
This commit is contained in:
parent
dda21701c5
commit
1cb70547fb
1 changed files with 14 additions and 3 deletions
|
@ -975,7 +975,10 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
|
||||
if (
|
||||
isImage(attachments) ||
|
||||
(isVideo(attachments) && hasVideoScreenshot(attachments))
|
||||
(isVideo(attachments) &&
|
||||
(!isDownloaded(attachments[0]) ||
|
||||
!attachments?.[0].pending ||
|
||||
hasVideoScreenshot(attachments)))
|
||||
) {
|
||||
const bottomOverlay = !isSticker && !collapseMetadata;
|
||||
// We only want users to tab into this if there's more than one
|
||||
|
@ -1082,7 +1085,16 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
)}
|
||||
// There's only ever one of these, so we don't want users to tab into it
|
||||
tabIndex={-1}
|
||||
onClick={this.openGenericAttachment}
|
||||
onClick={() => {
|
||||
if (!isDownloaded(firstAttachment)) {
|
||||
kickOffAttachmentDownload({
|
||||
attachment: firstAttachment,
|
||||
messageId: id,
|
||||
});
|
||||
} else {
|
||||
this.openGenericAttachment();
|
||||
}
|
||||
}}
|
||||
>
|
||||
{pending ? (
|
||||
<div className="module-message__generic-attachment__spinner-container">
|
||||
|
@ -2736,7 +2748,6 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
attachments &&
|
||||
attachments.length > 0 &&
|
||||
!isAttachmentPending &&
|
||||
(isImage(attachments) || isVideo(attachments)) &&
|
||||
!isDownloaded(attachments[0])
|
||||
) {
|
||||
event.preventDefault();
|
||||
|
|
Loading…
Add table
Reference in a new issue