From 5907b8fbc900c640c961dc90816842b99b30f3ed Mon Sep 17 00:00:00 2001 From: Hampus Date: Tue, 6 Jan 2026 16:23:20 +0100 Subject: [PATCH] fix(embed): react duplicate key issue (#64) --- .../components/channel/MessageAttachments.tsx | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/fluxer_app/src/components/channel/MessageAttachments.tsx b/fluxer_app/src/components/channel/MessageAttachments.tsx index 70fe831b..55e15919 100644 --- a/fluxer_app/src/components/channel/MessageAttachments.tsx +++ b/fluxer_app/src/components/channel/MessageAttachments.tsx @@ -193,20 +193,23 @@ const ForwardedMessageContent = observer(({message, snapshot}: {message: Message )} - {snapshot.embeds && snapshot.embeds.length > 0 && UserSettingsStore.getRenderEmbeds() && ( -
- {snapshot.embeds.map((embed: MessageEmbed, index: number) => ( - {}} - /> - ))} -
- )} + {snapshot.embeds && snapshot.embeds.length > 0 && UserSettingsStore.getRenderEmbeds() && ( +
+ {snapshot.embeds.map((embed: MessageEmbed, index: number) => { + const embedKey = `${embed.id}-${index}`; + return ( + {}} + /> + ); + })} +
+ )} @@ -328,9 +331,12 @@ export const MessageAttachments = observer(() => { {UserSettingsStore.getRenderEmbeds() && !message.suppressEmbeds && - message.embeds.map((embed, index) => ( - - ))} + message.embeds.map((embed, index) => { + const embedKey = `${embed.id}-${index}`; + return ( + + ); + })} {UserSettingsStore.getRenderReactions() && message.reactions.length > 0 && (