Commit 8f76c834 authored by Bady's avatar Bady
Browse files

Fix socket emit on server side

parent 2c885746
......@@ -19,8 +19,8 @@ var leafno = 0;
var socketids = [];
io.on('connection', (socket) => {
var id = socket.id;
io.sockets.socket(id).emit('leaves data', leavesdata);
let id = socket.id;
io.to(id).emit('leaves data', leavesdata);
socketids.push(id);
// when the client emits 'leaf data'
socket.on('leaf text', (leafdata) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment