BUGFIX: could not save user's preferences when categories where watched/tracked/muted

This commit is contained in:
Régis Hanol 2014-01-14 20:30:35 +01:00
parent 92cb52e76e
commit 8e5b736caa
2 changed files with 6 additions and 3 deletions

View File

@ -15,7 +15,11 @@ Discourse.CategoryGroupComponent = Ember.Component.extend({
}); });
}, },
onChangeItems: function(items) { 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(), template: Discourse.CategoryGroupComponent.templateFunction(),
transformComplete: function(category) { transformComplete: function(category) {

View File

@ -26,7 +26,6 @@ Discourse.User = Discourse.Model.extend({
**/ **/
staff: Em.computed.or('admin', 'moderator'), staff: Em.computed.or('admin', 'moderator'),
searchContext: function() { searchContext: function() {
return { return {
type: 'user', type: 'user',