mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-21 17:08:11 +01:00
Add download button and pending spinner for audio messages
This commit is contained in:
committed by
Josh Perez
parent
f98c3cba8c
commit
05f59f3db1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user