From 4b1974cd72f36795cbd355fd259caf6fb99d71a8 Mon Sep 17 00:00:00 2001 From: Jeffrey Yu <35394596+JeffreytheCoder@users.noreply.github.com> Date: Fri, 12 Apr 2024 07:45:40 -0700 Subject: [PATCH] Parse breaklines when editing multi-line message (#551) --- packages/react/src/components/ChatInput/ChatInput.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react/src/components/ChatInput/ChatInput.js b/packages/react/src/components/ChatInput/ChatInput.js index ef010f644..496707647 100644 --- a/packages/react/src/components/ChatInput/ChatInput.js +++ b/packages/react/src/components/ChatInput/ChatInput.js @@ -228,7 +228,10 @@ const ChatInput = ({ scrollToBottom }) => { } setDisableButton(true); } else { - const res = await RCInstance.updateMessage(editMessage._id, message); + const res = await RCInstance.updateMessage( + editMessage._id, + message.replace(/\n/g, '\\n') + ); if (!res.success) { await RCInstance.logout(); setIsUserAuthenticated(false);