Use native ES5 map method instead of lodash's
This commit is contained in:
parent
089c315a8e
commit
e905c139d7
@ -458,14 +458,7 @@ Client.prototype.save = function(force) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var networks = _.map(
|
|
||||||
this.networks,
|
|
||||||
function(n) {
|
|
||||||
return n.export();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
var json = {};
|
var json = {};
|
||||||
json.networks = networks;
|
json.networks = this.networks.map(n => n.export());
|
||||||
client.manager.updateUser(client.name, json);
|
client.manager.updateUser(client.name, json);
|
||||||
};
|
};
|
||||||
|
@ -143,10 +143,7 @@ ClientManager.prototype.removeUser = function(name) {
|
|||||||
ClientManager.prototype.autoload = function(/* sockets */) {
|
ClientManager.prototype.autoload = function(/* sockets */) {
|
||||||
var self = this;
|
var self = this;
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
var loaded = _.map(
|
var loaded = self.clients.map(c => c.name);
|
||||||
self.clients,
|
|
||||||
"name"
|
|
||||||
);
|
|
||||||
var added = _.difference(self.getUsers(), loaded);
|
var added = _.difference(self.getUsers(), loaded);
|
||||||
added.forEach(name => self.loadUser(name));
|
added.forEach(name => self.loadUser(name));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user