From f50237396f18ff9dbb1e9bd93383431ed8febc78 Mon Sep 17 00:00:00 2001 From: Jan Keromnes Date: Thu, 26 Aug 2021 10:30:18 +0200 Subject: [PATCH] [dashboard] Only initialize WorkspaceLogs once (not on every update) --- components/dashboard/src/components/WorkspaceLogs.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/dashboard/src/components/WorkspaceLogs.tsx b/components/dashboard/src/components/WorkspaceLogs.tsx index 345ef266b576d2..9bccbe636547c6 100644 --- a/components/dashboard/src/components/WorkspaceLogs.tsx +++ b/components/dashboard/src/components/WorkspaceLogs.tsx @@ -56,7 +56,7 @@ export default function WorkspaceLogs(props: WorkspaceLogsProps) { return function cleanUp() { terminal.dispose(); } - }); + }, []); useEffect(() => { // Fit terminal on window resize (debounced) @@ -70,7 +70,7 @@ export default function WorkspaceLogs(props: WorkspaceLogsProps) { clearTimeout(timeout!); window.removeEventListener('resize', onWindowResize); } - }); + }, []); useEffect(() => { if (terminalRef.current && props.errorMessage) {