switch .filter to uniq

This commit is contained in:
Barış Soner Uşaklı
2017-06-25 19:05:13 -04:00
parent fd43f38e42
commit c36f25f761
3 changed files with 18 additions and 28 deletions

View File

@@ -160,9 +160,7 @@ Notifications.push = function (notification, uids, callback) {
uids = [uids];
}
uids = uids.filter(function (uid, index, array) {
return parseInt(uid, 10) && array.indexOf(uid) === index;
});
uids = _.uniq(uids);
if (!uids.length) {
return callback();