MediaAttachmentGrid: fix the element not updated
All checks were successful
/ depoly (push) Successful in 1m19s

This problem causes "not supported codec"
This commit is contained in:
thislight 2024-11-07 23:57:11 +08:00
parent f965bb4002
commit acde7609ba
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E

View file

@ -152,6 +152,7 @@ const MediaAttachmentGrid: Component<{
return (
<img
data-sort={index}
data-media-type={item().type}
src={item().previewUrl}
width={item().meta?.small?.width}
height={item().meta?.small?.height}
@ -165,6 +166,7 @@ const MediaAttachmentGrid: Component<{
return (
<video
data-sort={index}
data-media-type={item().type}
src={item().url || undefined}
autoplay={settings().autoPlayVideos}
playsinline={settings().autoPlayVideos ? true : undefined}
@ -178,6 +180,8 @@ const MediaAttachmentGrid: Component<{
case "gifv":
return (
<video
data-sort={index}
data-media-type={item().type}
src={item().url || undefined}
autoplay={settings().autoPlayGIFs}
controls
@ -191,6 +195,14 @@ const MediaAttachmentGrid: Component<{
);
case "audio":
return (
<audio
data-sort={index}
data-media-type={item().type}
src={item().url || undefined}
controls
></audio>
);
case "unknown":
return <div></div>;
}