diff --git a/src/components/planner/sidebar/sessionController/CollabModal.tsx b/src/components/planner/sidebar/sessionController/CollabModal.tsx index 46d6d10d..153a61bc 100644 --- a/src/components/planner/sidebar/sessionController/CollabModal.tsx +++ b/src/components/planner/sidebar/sessionController/CollabModal.tsx @@ -60,6 +60,7 @@ const CollabModal = ({ isOpen, closeModal }: Props) => { const handleExitSession = () => { sessionsSocket.disconnect(); toast({ title: 'Sessão abandonada', description: 'Podes voltar a ela mais tarde, ou iniciar/entrar noutra sessão.'}); + setCurrentSessionId(null); setCurrentView(PICK_SESSION); }; diff --git a/src/components/planner/sidebar/sessionController/CollaborativeSession.tsx b/src/components/planner/sidebar/sessionController/CollaborativeSession.tsx index 6d50ad7c..41a3330a 100644 --- a/src/components/planner/sidebar/sessionController/CollaborativeSession.tsx +++ b/src/components/planner/sidebar/sessionController/CollaborativeSession.tsx @@ -39,7 +39,7 @@ const CollaborativeSession = () => { return (
- diff --git a/src/index.tsx b/src/index.tsx index 47acd1b2..81a8fedf 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,10 +1,34 @@ import React from 'react' import ReactDOM from 'react-dom/client' import App from './App' +import './api/socket' +import { sessionsSocket } from './api/socket' const strictMode = false const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement) +// sessionsSocket.connect(); + +// sessionsSocket.on('connected', data => { +// console.log('Connected to sessions socket'); +// console.log(data); +// }); + +// sessionsSocket.onAny((event, data) => { +// console.log('Received event from sessions socket'); +// console.log(event); +// console.log(data); +// }) + +// sessionsSocket.on('disconnect', data => { +// console.log('Disconnected from sessions socket'); +// console.log(data); +// }); + +// setTimeout(() => { +// sessionsSocket.emit('test', 'Hello, world!'); +// }); + root.render(strictMode ?