web/timeline: remove redundant fragment around file download button

This commit is contained in:
Tulir Asokan 2024-12-02 23:38:32 +02:00
parent 229751a286
commit dee7e5c72d

View file

@ -69,18 +69,14 @@ export const useMediaContent = (
} else if (content.msgtype === "m.audio") { } else if (content.msgtype === "m.audio") {
return [<audio controls src={mediaURL} preload="none"/>, "audio-container", {}] return [<audio controls src={mediaURL} preload="none"/>, "audio-container", {}]
} else if (content.msgtype === "m.file") { } else if (content.msgtype === "m.file") {
return [ return [<a
<> href={mediaURL}
<a target="_blank"
href={mediaURL} rel="noopener noreferrer"
target="_blank" download={content.filename ?? content.body}
rel="noopener noreferrer" >
download={content.filename ?? content.body} <DownloadIcon height={32} width={32}/> {content.filename ?? content.body}
><DownloadIcon height={32} width={32}/> {content.filename ?? content.body}</a> </a>, "file-container", {}]
</>,
"file-container",
{},
]
} }
return [null, "unknown-container", {}] return [null, "unknown-container", {}]
} }