From 02a7a579f4c872ca94d72fa4697d53f48e509a38 Mon Sep 17 00:00:00 2001 From: cpradio Date: Mon, 1 Sep 2014 13:56:19 -0400 Subject: [PATCH] FIX: Duplicate badge titles can still occur Send false instead of true to .uniq as the badges are not sorted. https://meta.discourse.org/t/set-title-dialog-shows-multiple-instances-of-the-same-badge-2/19495 --- .../discourse/controllers/preferences/badge-title.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/preferences/badge-title.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/badge-title.js.es6 index 554cd9ed8..bb0cc4ffb 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/badge-title.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/badge-title.js.es6 @@ -20,7 +20,7 @@ export default Ember.ArrayController.extend({ selectableUserBadges: function() { var items = this.get('model').filterBy('badge.allow_title', true); - items = _.uniq(items, true, function(e) { return e.get('badge.name'); }); + items = _.uniq(items, false, function(e) { return e.get('badge.name'); }); items.unshiftObject(Em.Object.create({ badge: Discourse.Badge.create({name: I18n.t('badges.no_title')}) }));