mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 08:48:47 +01:00
Better ID for media attachments
The `i` persists for other attachments too. Not good.
This commit is contained in:
parent
8a8dad12c8
commit
3506285176
1 changed files with 3 additions and 2 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue