1
0
Fork 0

Better ID for media attachments

The `i` persists for other attachments too. Not good.
This commit is contained in:
Lim Chee Aun 2023-01-09 14:33:47 +08:00
parent 8a8dad12c8
commit 3506285176

View file

@ -726,10 +726,11 @@ function Compose({
{mediaAttachments.length > 0 && (
<div class="media-attachments">
{mediaAttachments.map((attachment, i) => {
const { id } = attachment;
const { id, file } = attachment;
const fileID = file?.size + file?.type + file?.name;
return (
<MediaAttachment
key={i + id}
key={id || fileID || i}
attachment={attachment}
disabled={uiState === 'loading'}
onDescriptionChange={(value) => {