diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 17c32e500..2bea3eeb3 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -16,7 +16,7 @@ export default function Chat({ flow }: ChatType) { const handleKeyDown = (event: KeyboardEvent) => { if ( (event.key === "K" || event.key === "k") && - (event.metaKey || event.ctrlKey) + (event.metaKey || event.ctrlKey) && isBuilt ) { event.preventDefault(); setOpen((oldState) => !oldState); @@ -26,7 +26,7 @@ export default function Chat({ flow }: ChatType) { return () => { document.removeEventListener("keydown", handleKeyDown); }; - }, []); + }, [isBuilt]); useEffect(() => { // Define an async function within the useEffect hook