Permalink
Browse files

Small fixes

  • Loading branch information...
1 parent ae62563 commit 109a3b501e85713259ca19d607ea89252d7e6f65 @pksunkara committed Sep 18, 2011
Showing with 2 additions and 1 deletion.
  1. +1 −0 app.js
  2. +1 −1 public/javascripts/collab.js
View
1 app.js
@@ -60,6 +60,7 @@ var sessions = [];
io.sockets.on('connection', function(socket){
socket.emit('nickname?', {});
socket.on('nickname', function(data){
+ data = (data===null)? randomString() : data;
console.log(data, 'joined the session');
socket.emit('members', sessions);
io.sockets.emit('join', {name: data, msg: data+' has joined the session'});
@@ -33,7 +33,7 @@ socket.on('nickname?', function(data){
putChat(data.msg);
});
socket.on('quit', function(data){
- members.slice(members.indexOf(data.name)+1);
+ members.splice(members.indexOf(data.name), 1);
updateMembers();
putChat(data.msg);
});

0 comments on commit 109a3b5

Please sign in to comment.