diff --git a/app/assets/javascripts/discourse/controllers/preferences/categories.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/categories.js.es6 index 58103411a81..f394acd3e1e 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/categories.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/categories.js.es6 @@ -1,5 +1,6 @@ import PreferencesTabController from "discourse/mixins/preferences-tab-controller"; import { popupAjaxError } from 'discourse/lib/ajax-error'; +import { default as computed } from "ember-addons/ember-computed-decorators"; export default Ember.Controller.extend(PreferencesTabController, { saveAttrNames: [ @@ -9,6 +10,11 @@ export default Ember.Controller.extend(PreferencesTabController, { 'watched_first_post_category_ids' ], + @computed("model.watchedCategories", "model.watchedFirstPostCategories", "model.trackedCategories", "model.mutedCategories") + selectedCategories(watched, watchedFirst, tracked, muted) { + return [].concat(watched, watchedFirst, tracked, muted); + }, + canSave: function() { return this.get('currentUser.id') === this.get('model.id') || this.get('currentUser.admin'); diff --git a/app/assets/javascripts/discourse/controllers/preferences/notifications.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/notifications.js.es6 index bd9609b09a9..dbc8a4aa2f5 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/notifications.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/notifications.js.es6 @@ -1,5 +1,4 @@ import PreferencesTabController from "discourse/mixins/preferences-tab-controller"; -import { default as computed } from "ember-addons/ember-computed-decorators"; import { NotificationLevels } from 'discourse/lib/notification-levels'; import { popupAjaxError } from 'discourse/lib/ajax-error'; @@ -14,11 +13,6 @@ export default Ember.Controller.extend(PreferencesTabController, { 'allow_private_messages', ], - @computed("model.watchedCategories", "model.trackedCategories", "model.mutedCategories") - selectedCategories(watched, tracked, muted) { - return [].concat(watched, tracked, muted); - }, - likeNotificationFrequencies: [{ name: I18n.t('user.like_notification_frequency.always'), value: 0 }, { name: I18n.t('user.like_notification_frequency.first_time_and_daily'), value: 1 }, { name: I18n.t('user.like_notification_frequency.first_time'), value: 2 }, diff --git a/app/assets/javascripts/discourse/templates/preferences/categories.hbs b/app/assets/javascripts/discourse/templates/preferences/categories.hbs index d4f4bf67a7b..ee57fea81e4 100644 --- a/app/assets/javascripts/discourse/templates/preferences/categories.hbs +++ b/app/assets/javascripts/discourse/templates/preferences/categories.hbs @@ -1,5 +1,4 @@