diff --git a/app/react/components/dom/chat/chat.jsx b/app/react/components/dom/chat/chat.jsx index 2d55f19..989ca7a 100644 --- a/app/react/components/dom/chat/chat.jsx +++ b/app/react/components/dom/chat/chat.jsx @@ -8,7 +8,6 @@ export default function Chat({ chatHistoryCaret, chatInputRef, chatMessages, - onClose, message, pendingMessage, setChatHistoryCaret, @@ -33,7 +32,6 @@ export default function Chat({ { if (chatInputRef.current) { chatInputRef.current.focus(); - } - if (chatIsOpen) { return; } let actionPayload; @@ -130,7 +128,6 @@ function Ui({disconnected}) { } }); }, [ - chatIsOpen, client, ]); const keepHotbarOpen = useCallback(() => { @@ -146,14 +143,12 @@ function Ui({disconnected}) { }, [hotbarHideHandle, isInventoryOpen]); useEffect(() => { return addKeyListener(document.body, ({event, type, payload}) => { - if ('Escape' === payload && 'keyDown' === type && chatIsOpen) { + if ('Escape' === payload && 'keyDown' === type && chatInputRef.current) { setChatIsOpen(false); return; } if (chatInputRef.current) { chatInputRef.current.focus(); - } - if (chatIsOpen) { return; } let actionPayload; @@ -300,7 +295,6 @@ function Ui({disconnected}) { } }); }, [ - chatIsOpen, client, devtoolsIsOpen, hotbarHideHandle, @@ -477,7 +471,7 @@ function Ui({disconnected}) {
{ - if (chatIsOpen) { + if (chatInputRef.current) { event.preventDefault(); return; } @@ -510,7 +504,7 @@ function Ui({disconnected}) { } }} onMouseUp={(event) => { - if (chatIsOpen) { + if (chatInputRef.current) { event.preventDefault(); return; } @@ -532,7 +526,7 @@ function Ui({disconnected}) { event.preventDefault(); }} onWheel={(event) => { - if (chatIsOpen) { + if (chatInputRef.current) { event.preventDefault(); return; } @@ -619,9 +613,6 @@ function Ui({disconnected}) { setChatHistoryCaret={setChatHistoryCaret} setMessage={setMessage} setPendingMessage={setPendingMessage} - onClose={() => { - setChatIsOpen(false); - }} /> )} {showDisconnected && (