Fix the if statement

This commit is contained in:
Bill 2022-08-08 01:01:55 -04:00
parent 33fb28ad5a
commit 5c2c009292

View File

@ -89,18 +89,16 @@ 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;
}
else
{
setChatValue('');
sendChat(text, chatType, recipientName, chatStyleId);
}
}
setChatValue(append);
}, [ chatModeIdWhisper, chatModeIdShout, chatModeIdSpeak, maxChatLength, chatStyleId, setIsTyping, setIsIdle, sendChat ]);