mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-06 08:55:08 +00:00
(js) Fix possible errors (help from jsjint)
This commit is contained in:
@@ -59,7 +59,10 @@
|
||||
User.$query = search;
|
||||
|
||||
return User.$$resource.fetch(null, 'usersSearch', param).then(function(response) {
|
||||
var results, index, user;
|
||||
var results, index, user,
|
||||
compareUids = function(data) {
|
||||
return user.uid == data.uid;
|
||||
};
|
||||
if (excludedUsers) {
|
||||
// Remove excluded users from response
|
||||
results = _.filter(response.users, function(data) {
|
||||
@@ -84,9 +87,7 @@
|
||||
// Remove users that no longer match the search query
|
||||
for (index = User.$users.length - 1; index >= 0; index--) {
|
||||
user = User.$users[index];
|
||||
if (!_.find(results, function(data) {
|
||||
return user.uid == data.uid;
|
||||
})) {
|
||||
if (!_.find(results, compareUids)) {
|
||||
User.$users.splice(index, 1);
|
||||
}
|
||||
}
|
||||
@@ -109,10 +110,6 @@
|
||||
this.$$image = this.image || User.$gravatar(this.c_email);
|
||||
};
|
||||
|
||||
User.prototype.toString = function() {
|
||||
return '[User ' + this.c_email + ']';
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $shortFormat
|
||||
* @memberof User.prototype
|
||||
@@ -276,4 +273,8 @@
|
||||
return user;
|
||||
};
|
||||
|
||||
User.prototype.toString = function() {
|
||||
return '[User ' + this.c_email + ']';
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user