From 883da89c7055ce15c8a91c06563bb963218bbffb Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Wed, 11 Nov 2020 11:17:44 +0100 Subject: [PATCH] DEV: Replace a full computed prop with readOnly --- .../javascripts/discourse/app/components/d-navigation.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/d-navigation.js b/app/assets/javascripts/discourse/app/components/d-navigation.js index b75ba8ee18..080581cb4c 100644 --- a/app/assets/javascripts/discourse/app/components/d-navigation.js +++ b/app/assets/javascripts/discourse/app/components/d-navigation.js @@ -4,12 +4,15 @@ import { inject as service } from "@ember/service"; import Component from "@ember/component"; import FilterModeMixin from "discourse/mixins/filter-mode"; import bootbox from "bootbox"; +import { readOnly } from "@ember/object/computed"; export default Component.extend(FilterModeMixin, { router: service(), tagName: "", + categories: readOnly("site.categoriesList"), + @discourseComputed("category") showCategoryNotifications(category) { return category && this.currentUser; @@ -53,11 +56,6 @@ export default Component.extend(FilterModeMixin, { } }, - @discourseComputed() - categories() { - return this.site.get("categoriesList"); - }, - @discourseComputed("hasDraft") createTopicLabel(hasDraft) { return hasDraft ? "topic.open_draft" : "topic.create";