refactor: use loash when possible (#7230)

This commit is contained in:
Peter Jaszkowiak
2019-01-12 12:28:53 -07:00
committed by Barış Soner Uşaklı
parent a4ab13d323
commit e1ca2d81f9
4 changed files with 31 additions and 50 deletions

View File

@@ -558,11 +558,9 @@ Notifications.merge = function (notifications, callback) {
case 'notifications:user_posted_to':
case 'notifications:user_flagged_post_in':
case 'notifications:user_flagged_user':
var usernames = set.map(function (notifObj) {
var usernames = _.uniq(set.map(function (notifObj) {
return notifObj && notifObj.user && notifObj.user.username;
}).filter(function (username, idx, array) {
return array.indexOf(username) === idx;
});
}));
var numUsers = usernames.length;
var title = utils.decodeHTMLEntities(notifications[modifyIndex].topicTitle || '');