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 (
|
if (
|
||||||
isImage(attachments) ||
|
isImage(attachments) ||
|
||||||
(isVideo(attachments) && hasVideoScreenshot(attachments))
|
(isVideo(attachments) &&
|
||||||
|
(!isDownloaded(attachments[0]) ||
|
||||||
|
!attachments?.[0].pending ||
|
||||||
|
hasVideoScreenshot(attachments)))
|
||||||
) {
|
) {
|
||||||
const bottomOverlay = !isSticker && !collapseMetadata;
|
const bottomOverlay = !isSticker && !collapseMetadata;
|
||||||
// We only want users to tab into this if there's more than one
|
// 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
|
// There's only ever one of these, so we don't want users to tab into it
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
onClick={this.openGenericAttachment}
|
onClick={() => {
|
||||||
|
if (!isDownloaded(firstAttachment)) {
|
||||||
|
kickOffAttachmentDownload({
|
||||||
|
attachment: firstAttachment,
|
||||||
|
messageId: id,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.openGenericAttachment();
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{pending ? (
|
{pending ? (
|
||||||
<div className="module-message__generic-attachment__spinner-container">
|
<div className="module-message__generic-attachment__spinner-container">
|
||||||
|
@ -2736,7 +2748,6 @@ export class Message extends React.PureComponent<Props, State> {
|
||||||
attachments &&
|
attachments &&
|
||||||
attachments.length > 0 &&
|
attachments.length > 0 &&
|
||||||
!isAttachmentPending &&
|
!isAttachmentPending &&
|
||||||
(isImage(attachments) || isVideo(attachments)) &&
|
|
||||||
!isDownloaded(attachments[0])
|
!isDownloaded(attachments[0])
|
||||||
) {
|
) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue