diff --git a/app/assets/javascripts/discourse/app/models/topic.js b/app/assets/javascripts/discourse/app/models/topic.js index ed9c2634e09..7392b1072f8 100644 --- a/app/assets/javascripts/discourse/app/models/topic.js +++ b/app/assets/javascripts/discourse/app/models/topic.js @@ -227,10 +227,9 @@ const Topic = RestModel.extend({ return { type: "topic", id }; }, - @on("init") - @observes("category_id") - _categoryIdChanged() { - this.set("category", Category.findById(this.category_id)); + @discourseComputed("category_id") + category(categoryId) { + return Category.findById(categoryId); }, categoryClass: fmt("category.fullSlug", "category-%@"),