From 9b8ea8c90c9005aaf25fec0173cf4e41fdaa645d Mon Sep 17 00:00:00 2001 From: anastasiia Date: Mon, 18 Dec 2023 07:57:51 -0500 Subject: [PATCH] fix error when pasting to the input --- client/src/components/Chat/ChatFooter/Input/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/components/Chat/ChatFooter/Input/utils.ts b/client/src/components/Chat/ChatFooter/Input/utils.ts index aa401876db..19dd2d439d 100644 --- a/client/src/components/Chat/ChatFooter/Input/utils.ts +++ b/client/src/components/Chat/ChatFooter/Input/utils.ts @@ -17,7 +17,9 @@ export const mapEditorContentToInputValue = ( .map((s) => s.type === 'mention' ? `${getType(s.attrs.type)}:${s.attrs.id}` - : s.text.replace(new RegExp(String.fromCharCode(160), 'g'), ' '), + : s.type === 'text' + ? s.text?.replace(new RegExp(String.fromCharCode(160), 'g'), ' ') + : '', ) .join(''); const newValueParsed = inputState.map((s) =>