added force send update when server comes back

This commit is contained in:
cubedro
2015-02-17 20:22:06 +02:00
parent 05f4bf1c9e
commit 0870b66468
2 changed files with 3 additions and 15 deletions

View File

@@ -77,7 +77,7 @@ function Node()
if(self.changed())
{
self._socket = true;
self.sendUpdate();
self.sendUpdate(true);
}
console.log('The connection has been established.');
@@ -268,9 +268,9 @@ Node.prototype.prepareStats = function()
};
}
Node.prototype.sendUpdate = function()
Node.prototype.sendUpdate = function(force)
{
if(this.changed())
if(this.changed() || force)
this.emit('update', this.prepareStats());
}