Add download button and pending spinner for audio messages
This commit is contained in:
parent
f98c3cba8c
commit
05f59f3db1
9 changed files with 246 additions and 102 deletions
|
@ -85,9 +85,11 @@ export type AudioAttachmentProps = {
|
|||
buttonRef: React.RefObject<HTMLButtonElement>;
|
||||
direction: DirectionType;
|
||||
theme: ThemeType | undefined;
|
||||
url: string;
|
||||
attachment: AttachmentType;
|
||||
withContentAbove: boolean;
|
||||
withContentBelow: boolean;
|
||||
|
||||
kickOffAttachmentDownload(): void;
|
||||
};
|
||||
|
||||
export type PropsData = {
|
||||
|
@ -754,16 +756,23 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
if (!firstAttachment.pending && isAudio(attachments)) {
|
||||
if (isAudio(attachments)) {
|
||||
return renderAudioAttachment({
|
||||
i18n,
|
||||
buttonRef: this.audioButtonRef,
|
||||
id,
|
||||
direction,
|
||||
theme,
|
||||
url: firstAttachment.url,
|
||||
attachment: firstAttachment,
|
||||
withContentAbove,
|
||||
withContentBelow,
|
||||
|
||||
kickOffAttachmentDownload() {
|
||||
kickOffAttachmentDownload({
|
||||
attachment: firstAttachment,
|
||||
messageId: id,
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
const { pending, fileName, fileSize, contentType } = firstAttachment;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue