snapdrop

A Progressive Web App for local file sharing
git clone http://git.hanabi.in/repos/snapdrop.git
Log | Files | Refs | README | LICENSE

commit 6a940acad2d3d8c9dc996a00c9cd500f874a4ebe
parent 0ccd4c6e7b4f99010a9a2a02f8c52bb20172339c
Author: Robin Linus <robin_woll@capira.de>
Date:   Wed, 30 Dec 2015 23:47:15 +0100

Use JSON.stringify instead of toString

Diffstat:
Mserver/ws-server.js | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/server/ws-server.js b/server/ws-server.js @@ -94,7 +94,7 @@ exports.create = function(server) { - function notifyBuddiesX() { + function notifyBuddies() { var locations = {}; //group all clients by location (by public ip address) forEachClient(function(client) { @@ -120,7 +120,8 @@ exports.create = function(server) { } return result; }, []); - var currState = hash(buddies.toString()); + var currState = hash(JSON.stringify(buddies)); + console.log(currState); var socket = client.socket; //protocol var msg = { @@ -137,5 +138,5 @@ exports.create = function(server) { }); } - setInterval(notifyBuddiesX, 3000); + setInterval(notifyBuddies, 3000); };