From 8e5b736caabce47b762bb0bd669beffff33671b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 14 Jan 2014 20:30:35 +0100 Subject: [PATCH] BUGFIX: could not save user's preferences when categories where watched/tracked/muted --- .../discourse/components/category_group_component.js | 8 ++++++-- app/assets/javascripts/discourse/models/user.js | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/components/category_group_component.js b/app/assets/javascripts/discourse/components/category_group_component.js index e8a97ff91fc..b2cb1e96d77 100644 --- a/app/assets/javascripts/discourse/components/category_group_component.js +++ b/app/assets/javascripts/discourse/components/category_group_component.js @@ -15,10 +15,14 @@ Discourse.CategoryGroupComponent = Ember.Component.extend({ }); }, onChangeItems: function(items) { - self.set("categories", items); + var categories = _.map(items, function(link) { + var slug = link.match(/href=['"]\/category\/([^'"]+)/)[1]; + return Discourse.Category.findSingleBySlug(slug); + }); + self.set("categories", categories); }, template: Discourse.CategoryGroupComponent.templateFunction(), - transformComplete: function(category){ + transformComplete: function(category) { return Discourse.HTML.categoryLink(category, {allowUncategorized: true}); } }); diff --git a/app/assets/javascripts/discourse/models/user.js b/app/assets/javascripts/discourse/models/user.js index 1cfb7edb0c2..a33d6bca01c 100644 --- a/app/assets/javascripts/discourse/models/user.js +++ b/app/assets/javascripts/discourse/models/user.js @@ -26,7 +26,6 @@ Discourse.User = Discourse.Model.extend({ **/ staff: Em.computed.or('admin', 'moderator'), - searchContext: function() { return { type: 'user',