From 5c2c009292711e9c76128f4fc104670b6f541c47 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 8 Aug 2022 01:01:55 -0400 Subject: [PATCH] Fix the if statement --- .../room/widgets/chat-input/ChatInputView.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/room/widgets/chat-input/ChatInputView.tsx b/src/components/room/widgets/chat-input/ChatInputView.tsx index b474378d..f5db0f43 100644 --- a/src/components/room/widgets/chat-input/ChatInputView.tsx +++ b/src/components/room/widgets/chat-input/ChatInputView.tsx @@ -89,17 +89,15 @@ export const ChatInputView: FC<{}> = props => if(text.length <= maxChatLength) { - const re = /%CC%/g - const hasZalgo = txt => re.test(encodeURIComponent(txt)); - - if (hasZalgo(text)) + if(/%CC%/g.test(encodeURIComponent(text))) { setChatValue(''); - return; } - - setChatValue(''); - sendChat(text, chatType, recipientName, chatStyleId); + else + { + setChatValue(''); + sendChat(text, chatType, recipientName, chatStyleId); + } } setChatValue(append);