From c14431c63bd95b234cf7a52082fc95f0fb18c9c2 Mon Sep 17 00:00:00 2001 From: PhilReact Date: Mon, 16 Dec 2024 05:14:34 +0200 Subject: [PATCH] bug fixes --- src/components/Chat/ChatGroup.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Chat/ChatGroup.tsx b/src/components/Chat/ChatGroup.tsx index 57bf908..87598b8 100644 --- a/src/components/Chat/ChatGroup.tsx +++ b/src/components/Chat/ChatGroup.tsx @@ -232,15 +232,15 @@ export const ChatGroup = ({selectedGroup, secretKey, setSecretKey, getSecretKey, setChatReferences((prev) => { const organizedChatReferences = { ...prev }; combineUIAndExtensionMsgs - .filter((rawItem) => rawItem && rawItem.chatReference && (rawItem.decryptedData?.type === "reaction" || rawItem.decryptedData?.type === "edit" || rawItem?.type === "edit" || rawItem?.type === "reaction")) + .filter((rawItem) => rawItem && rawItem.chatReference && (rawItem?.decryptedData?.type === "reaction" || rawItem?.decryptedData?.type === "edit" || rawItem?.type === "edit" || rawItem?.isEdited || rawItem?.type === "reaction")) .forEach((item) => { try { - if(item.decryptedData?.type === "edit"){ + if(item?.decryptedData?.type === "edit"){ organizedChatReferences[item.chatReference] = { ...(organizedChatReferences[item.chatReference] || {}), edit: item.decryptedData, }; - } else if(item?.type === "edit"){ + } else if(item?.type === "edit" || item?.isEdited){ organizedChatReferences[item.chatReference] = { ...(organizedChatReferences[item.chatReference] || {}), edit: item, @@ -320,15 +320,15 @@ export const ChatGroup = ({selectedGroup, secretKey, setSecretKey, getSecretKey, const organizedChatReferences = { ...prev }; combineUIAndExtensionMsgs - .filter((rawItem) => rawItem && rawItem.chatReference && (rawItem.decryptedData?.type === "reaction" || rawItem.decryptedData?.type === "edit" || rawItem?.type === "edit" || rawItem?.type === "reaction")) + .filter((rawItem) => rawItem && rawItem.chatReference && (rawItem?.decryptedData?.type === "reaction" || rawItem?.decryptedData?.type === "edit" || rawItem?.type === "edit" || rawItem?.isEdited || rawItem?.type === "reaction")) .forEach((item) => { try { - if(item.decryptedData?.type === "edit"){ + if(item?.decryptedData?.type === "edit"){ organizedChatReferences[item.chatReference] = { ...(organizedChatReferences[item.chatReference] || {}), edit: item.decryptedData, }; - } else if(item?.type === "edit"){ + } else if(item?.type === "edit" || item?.isEdited){ organizedChatReferences[item.chatReference] = { ...(organizedChatReferences[item.chatReference] || {}), edit: item,