Skip to content

Commit

Permalink
Use set question api in frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
gycgabriel committed Oct 15, 2023
1 parent 1dcb7ad commit aed2971
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/src/hooks/useCollaboration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ const useCollaboration = ({ roomId, userId }: UseCollaborationProps) => {
const prevTextRef = useRef<string>(text);
const awaitingAck = useRef<boolean>(false); // ack from sending update
const awaitingSync = useRef<boolean>(false); // synced with server
const questionId = "1";

useEffect(() => {
const socketConnection = io("http://localhost:5003/");
setSocket(socketConnection);

socketConnection.emit(SocketEvents.ROOM_JOIN, roomId, userId);
socketConnection.emit(SocketEvents.QUESTION_SET, questionId);

socketConnection.on(
SocketEvents.ROOM_UPDATE,
Expand Down

0 comments on commit aed2971

Please sign in to comment.