Send unhashed room ID

This commit is contained in:
Alan Friedman 2019-05-27 21:58:56 -04:00
parent 8614530163
commit 76baec6b5d

View File

@ -21,24 +21,9 @@ export default class Socket {
async init(opts) {
const { roomId, socket, room } = opts
await this.joinRoom(roomId, socket.id)
this.sendRoomInfo();
this.handleSocket(socket)
}
sendRoomInfo() {
let room;
if (_.isEmpty(this.room)) {
room = {
id: this.roomIdOriginal,
users: [],
isLocked: false,
}
} else {
room = this.room;
}
this.socket.emit('CONNECTED', room);
}
sendRoomLocked() {
this.socket.emit('ROOM_LOCKED');
}
@ -100,7 +85,10 @@ export default class Socket {
}
await this.saveRoom(newRoom)
getIO().to(this._roomId).emit('USER_ENTER', newRoom);
getIO().to(this._roomId).emit('USER_ENTER', {
...newRoom,
id: this.roomIdOriginal
});
})
socket.on('TOGGLE_LOCK_ROOM', async (data, callback) => {