mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Update ManageRoom.tsx
This commit is contained in:
parent
73f87c9a9e
commit
9cc152d6bc
1 changed files with 10 additions and 2 deletions
|
|
@ -96,8 +96,16 @@ const ManageRoom: React.FC = () => {
|
||||||
socket.on('create-failure', () => {
|
socket.on('create-failure', () => {
|
||||||
console.log('Error creating room.');
|
console.log('Error creating room.');
|
||||||
});
|
});
|
||||||
|
socket.on('user-joined', (user: UserType) => {
|
||||||
|
|
||||||
|
setUsers((prevUsers) => [...prevUsers, user]);
|
||||||
|
|
||||||
|
if (quizMode === 'teacher') {
|
||||||
|
webSocketService.nextQuestion(roomName, currentQuestion);
|
||||||
|
} else if (quizMode === 'student') {
|
||||||
|
webSocketService.launchStudentModeQuiz(roomName, quizQuestions);
|
||||||
|
}
|
||||||
|
});
|
||||||
socket.on('join-failure', (message) => {
|
socket.on('join-failure', (message) => {
|
||||||
setConnectingError(message);
|
setConnectingError(message);
|
||||||
setSocket(null);
|
setSocket(null);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue