Permalink
Browse files

Fixe client socket storage

  • Loading branch information...
1 parent 8a61822 commit 76eb971afc8ed7208a7182fd80f1581a91e1e96a @pksunkara committed Sep 18, 2011
Showing with 7 additions and 8 deletions.
  1. +7 −8 public/javascripts/collab.js
@@ -75,13 +75,12 @@ socket.on('edit', function (data){
docVersion += 1;
acee.getSession().setValue(text);
- socket.get('nickname', function(err, nickame){
- if(data.n == nickname){
- setCursor(data.d.cursor);
- } else {
- setCursor(currentCursor);
- }
- });
+ nickname = localStorage.getItem('nickname');
+ if(data.n == nickname){
+ setCursor(data.d.cursor);
+ } else {
+ setCursor(currentCursor);
+ }
});
socket.on('version', function(data){
@@ -92,7 +91,7 @@ socket.on('version', function(data){
socket.on('nickname?', function(data){
var nickname = prompt('Your nickname?');
socket.emit('nickname', nickname);
- socket.set('nickname', nickname);
+ localStorage.setItem('nickname', nickname);
socket.on('members', function(data){
members = data;
updateMembers();

0 comments on commit 76eb971

Please sign in to comment.