diff --git a/packages/react/src/components/ChatInput/ChatInput.js b/packages/react/src/components/ChatInput/ChatInput.js index cd5236cbe..90ef19ff7 100644 --- a/packages/react/src/components/ChatInput/ChatInput.js +++ b/packages/react/src/components/ChatInput/ChatInput.js @@ -95,7 +95,7 @@ const ChatInput = ({ scrollToBottom }) => { (state) => state.setIsLoginModalOpen ); - const [msgLongMsgLongErrorModal, setMsgLongErrorModal] = useState(false); + const [isMsgLong, setIsMsgLong] = useState(false); const { editMessage, @@ -129,11 +129,11 @@ const ChatInput = ({ scrollToBottom }) => { const openLoginModal = () => { setIsLoginModalOpen(true); }; - const openMsgLongErrorModal = () => { - setMsgLongErrorModal(true); + const openMsgLongModal = () => { + setIsMsgLong(true); }; - const closeMsgLongErrorModal = () => { - setMsgLongErrorModal(false); + const closeMsgLongModal = () => { + setIsMsgLong(false); }; const onJoin = async () => { @@ -176,7 +176,7 @@ const ChatInput = ({ scrollToBottom }) => { const msgMaxLength = 500; if (message.length > msgMaxLength) { - openMsgLongErrorModal(); + openMsgLongModal(); return; } @@ -247,7 +247,7 @@ const ChatInput = ({ scrollToBottom }) => { }; const handleConvertToAttachment = () => { - closeMsgLongErrorModal(); + closeMsgLongModal(); sendMessage(true); }; @@ -548,7 +548,7 @@ const ChatInput = ({ scrollToBottom }) => { sendMessage()} disabled={disableButton || isRecordingMessage} > @@ -567,20 +567,20 @@ const ChatInput = ({ scrollToBottom }) => { /> )} - {msgLongMsgLongErrorModal && ( + {isMsgLong && ( Message Too Long! - + { Send it as attachment instead?{' '} -