mirror of
https://github.com/RobinLinus/snapdrop.git
synced 2025-05-16 15:40:10 -07:00
Use JSON.stringify instead of toString
This commit is contained in:
parent
0ccd4c6e7b
commit
6a940acad2
@ -94,7 +94,7 @@ exports.create = function(server) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function notifyBuddiesX() {
|
function notifyBuddies() {
|
||||||
var locations = {};
|
var locations = {};
|
||||||
//group all clients by location (by public ip address)
|
//group all clients by location (by public ip address)
|
||||||
forEachClient(function(client) {
|
forEachClient(function(client) {
|
||||||
@ -120,7 +120,8 @@ exports.create = function(server) {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}, []);
|
}, []);
|
||||||
var currState = hash(buddies.toString());
|
var currState = hash(JSON.stringify(buddies));
|
||||||
|
console.log(currState);
|
||||||
var socket = client.socket;
|
var socket = client.socket;
|
||||||
//protocol
|
//protocol
|
||||||
var msg = {
|
var msg = {
|
||||||
@ -137,5 +138,5 @@ exports.create = function(server) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(notifyBuddiesX, 3000);
|
setInterval(notifyBuddies, 3000);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user