From 5ce6b6d1c9cf2f20a7e723bdfeb1bf96c7185f67 Mon Sep 17 00:00:00 2001 From: Dunsin Date: Fri, 29 Nov 2024 13:41:26 +0100 Subject: [PATCH] fix: md.render error in messageList --- client/src/components/Chat/MessageList.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/components/Chat/MessageList.jsx b/client/src/components/Chat/MessageList.jsx index d05c994c..da88ba2b 100644 --- a/client/src/components/Chat/MessageList.jsx +++ b/client/src/components/Chat/MessageList.jsx @@ -40,7 +40,9 @@ const MessageList = ({ function getRepliedMessage(replyTo) { return decryptedMessages.find((object) => object.id === replyTo); - } + } + + console.log(decryptedMessages) return ( decryptedMessages && @@ -154,7 +156,7 @@ const MessageList = ({ __html: md.render( badwordChoices[id] === 'hide' ? badwords.filter(message) - : badwordChoices[id] === 'show' && message + : badwordChoices[id] === 'show' ? message : message ), }} /> @@ -197,9 +199,9 @@ const MessageList = ({ export default MessageList; MessageList.propTypes = { - decryptedMessages: PropTypes.array.isRequired, + decryptedMessages: PropTypes.array, senderId: PropTypes.string.isRequired, - currentReplyMessageId: PropTypes.string.isRequired, + currentReplyMessageId: PropTypes.string, doSend: PropTypes.func.isRequired, inputRef: PropTypes.object.isRequired, cancelEdit: PropTypes.func.isRequired,