fix issue with re-encrypt notification

This commit is contained in:
PhilReact 2024-09-23 15:29:22 +03:00
parent 2c17ddc35d
commit 5bfedd119e
3 changed files with 9 additions and 8 deletions

View File

@ -241,7 +241,8 @@ export const ChatGroup = ({selectedGroup, secretKey, setSecretKey, getSecretKey,
useEffect(()=> {
const notifications = messages.filter((message)=> message?.text?.type === 'notification')
const notifications = messages.filter((message)=> message?.decryptedData
?.type === 'notification')
if(notifications.length === 0) return
const latestNotification = notifications.reduce((latest, current) => {
return current.timestamp > latest.timestamp ? current : latest;

View File

@ -159,8 +159,8 @@ export const MessageItem = ({
])}
/>
)}
{reply?.text?.type === "notification" ? (
<MessageDisplay htmlContent={reply.text?.data?.message} />
{reply?.decryptedData?.type === "notification" ? (
<MessageDisplay htmlContent={reply.decryptedData?.data?.message} />
) : (
<MessageDisplay isReply htmlContent={reply.text} />
)}
@ -176,8 +176,8 @@ export const MessageItem = ({
])}
/>
)}
{message?.text?.type === "notification" ? (
<MessageDisplay htmlContent={message.text?.data?.message} />
{message?.decryptedData?.type === "notification" ? (
<MessageDisplay htmlContent={message.decryptedData?.data?.message} />
) : (
<MessageDisplay htmlContent={message.text} />
)}
@ -265,8 +265,8 @@ export const ReplyPreview = ({message})=> {
])}
/>
)}
{message?.text?.type === "notification" ? (
<MessageDisplay htmlContent={message.text?.data?.message} />
{message?.decryptedData?.type === "notification" ? (
<MessageDisplay htmlContent={message.decryptedData?.data?.message} />
) : (
<MessageDisplay isReply htmlContent={message.text} />
)}

View File

@ -1039,7 +1039,7 @@ export const Group = ({
return false;
const isDiffMemberNumber =
memberCountFromSecretKeyData !== members?.memberCount &&
newEncryptionNotification?.text?.data?.numberOfMembers !==
newEncryptionNotification?.decryptedData?.data?.numberOfMembers !==
members?.memberCount;
if (isDiffMemberNumber) return true;