diff --git a/src/frontend/src/modals/formModal/index.tsx b/src/frontend/src/modals/formModal/index.tsx index 0952cd2f0..aae20f160 100644 --- a/src/frontend/src/modals/formModal/index.tsx +++ b/src/frontend/src/modals/formModal/index.tsx @@ -330,6 +330,15 @@ export default function FormModal({ // do not add connectWS on dependencies array }, [open]); + useEffect(() => { + return () => { + if (ws.current) { + console.log("closing ws"); + ws.current.close(); + } + }; + }, []); + useEffect(() => { if ( ws.current &&