REFACTOR: Remove `Discourse.SiteSettings` from some controllers

This commit is contained in:
Robin Ward 2020-07-21 12:30:41 -04:00
parent 17bccbb52f
commit f83c383177
4 changed files with 4 additions and 6 deletions

View File

@ -93,7 +93,7 @@ export default Controller.extend(ModalFunctionality, {
if (selected.get("is_custom_flag")) {
const len = this.get("message.length") || 0;
return (
len >= Discourse.SiteSettings.min_personal_message_post_length &&
len >= this.siteSettings.min_personal_message_post_length &&
len <= MAX_MESSAGE_LENGTH
);
}

View File

@ -68,7 +68,7 @@ export default Controller.extend(BulkTopicSelection, FilterModeMixin, {
@discourseComputed("category")
showTagFilter() {
return Discourse.SiteSettings.show_filter_by_tag;
return this.siteSettings.show_filter_by_tag;
},
@discourseComputed("additionalTags", "category", "tag.id")

View File

@ -21,7 +21,6 @@ export default Controller.extend({
init() {
this._super(...arguments);
this.set("searchTerm", "");
},
@ -141,8 +140,7 @@ export default Controller.extend({
model.invites.pushObjects(invite_model.invites);
if (
invite_model.invites.length === 0 ||
invite_model.invites.length <
Discourse.SiteSettings.invites_per_page
invite_model.invites.length < this.siteSettings.invites_per_page
) {
this.set("canLoadMore", false);
}

View File

@ -108,7 +108,7 @@ export default Controller.extend(CanCheckEmails, {
@discourseComputed("model.badge_count")
showBadges(badgeCount) {
return Discourse.SiteSettings.enable_badges && badgeCount > 0;
return this.siteSettings.enable_badges && badgeCount > 0;
},
@discourseComputed()