diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/users.js b/app/assets/javascripts/discourse/app/controllers/preferences/users.js index 5c5ac48cd3c..4c6719e3f4d 100644 --- a/app/assets/javascripts/discourse/app/controllers/preferences/users.js +++ b/app/assets/javascripts/discourse/app/controllers/preferences/users.js @@ -1,26 +1,11 @@ import Controller from "@ember/controller"; import { action, computed } from "@ember/object"; -import { alias, and } from "@ember/object/computed"; +import { and } from "@ember/object/computed"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { makeArray } from "discourse-common/lib/helpers"; import discourseComputed from "discourse-common/utils/decorators"; export default Controller.extend({ - ignoredUsernames: alias("model.ignored_usernames"), - - @discourseComputed("model.trust_level", "model.groups") - userCanIgnore(trustLevel) { - return ( - trustLevel >= this.siteSettings.min_trust_level_to_allow_ignore || - this.currentUser.can_ignore_users - ); - }, - - @discourseComputed("userCanIgnore", "model.staff") - ignoredEnabled(userCanIgnore, userIsStaff) { - return this.currentUser.staff || userCanIgnore || userIsStaff; - }, - allowPmUsersEnabled: and( "model.user_option.enable_allowed_pm_users", "model.user_option.allow_private_messages" diff --git a/app/assets/javascripts/discourse/app/templates/preferences/users.hbs b/app/assets/javascripts/discourse/app/templates/preferences/users.hbs index 6ffb37ffaaa..37d39f3f93e 100644 --- a/app/assets/javascripts/discourse/app/templates/preferences/users.hbs +++ b/app/assets/javascripts/discourse/app/templates/preferences/users.hbs @@ -1,5 +1,6 @@ -{{#if this.ignoredEnabled}} + +{{#if this.model.can_ignore_users}}