Skip to content

Commit

Permalink
fix: md.render error in messageList
Browse files Browse the repository at this point in the history
  • Loading branch information
Dun-sin committed Nov 29, 2024
1 parent d3f32ff commit 5ce6b6d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions client/src/components/Chat/MessageList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ const MessageList = ({

function getRepliedMessage(replyTo) {
return decryptedMessages.find((object) => object.id === replyTo);
}
}

console.log(decryptedMessages)

return (
decryptedMessages &&
Expand Down Expand Up @@ -154,7 +156,7 @@ const MessageList = ({
__html: md.render(
badwordChoices[id] === 'hide'
? badwords.filter(message)
: badwordChoices[id] === 'show' && message
: badwordChoices[id] === 'show' ? message : message
),
}}
/>
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5ce6b6d

Please sign in to comment.