From 556c9d15fe88ae542e9de0294430d92f851399eb Mon Sep 17 00:00:00 2001 From: ghalestrilo Date: Mon, 20 Jul 2020 19:02:30 -0300 Subject: [PATCH] :bug: fix console not opening/closing --- client/modules/IDE/components/Console.jsx | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/client/modules/IDE/components/Console.jsx b/client/modules/IDE/components/Console.jsx index 258ae425..263ef786 100644 --- a/client/modules/IDE/components/Console.jsx +++ b/client/modules/IDE/components/Console.jsx @@ -95,27 +95,16 @@ const Console = () => { useDidUpdate(() => { clearConsole(); dispatchConsoleEvent(consoleEvents); - }, [theme, fontSize]); // + }, [theme, fontSize]); - // const [consoleMessages, setConsoleMessages] = useState({}); - // this.consoleMessages.scrollTop = this.consoleMessages.scrollHeight; - - // const clearConsole = () => {}; - // const collapseConsole = () => {}; - // const expandConsole = () => {}; - - // const isExpanded = true; - // const fontSize = 16; - // const theme = {}; + const cm = useRef({}); // // 2. FIXME: Console is not opening/closing, and I suspect it has to do with this - const cm = useRef({}); - useDidUpdate(() => { if (cm.current) cm.current.scrollTop = cm.current.scrollHeight; }); - + useDidUpdate(() => { cm.current.scrollTop = cm.current.scrollHeight; }); const consoleClass = classNames({ 'preview-console': true, - 'preview-console--collapsed': isExpanded + 'preview-console--collapsed': !isExpanded }); return (