REFACTOR: Remove `Discourse.SiteSettings` from components

This commit is contained in:
Robin Ward 2020-07-21 12:33:14 -04:00
parent f83c383177
commit 9aab81f304
2 changed files with 3 additions and 4 deletions

View File

@ -76,7 +76,7 @@ export default buildCategoryPanel("general", {
parentCategories() {
return this.site
.get("categoriesList")
.filter(c => c.level + 1 < Discourse.SiteSettings.max_category_nesting);
.filter(c => c.level + 1 < this.siteSettings.max_category_nesting);
},
@discourseComputed(

View File

@ -42,8 +42,7 @@ export default Component.extend({
@discourseComputed("message.length")
customMessageLengthClasses(messageLength) {
return messageLength <
Discourse.SiteSettings.min_personal_message_post_length
return messageLength < this.siteSettings.min_personal_message_post_length
? "too-short"
: "ok";
},
@ -51,7 +50,7 @@ export default Component.extend({
@discourseComputed("message.length")
customMessageLength(messageLength) {
const len = messageLength || 0;
const minLen = Discourse.SiteSettings.min_personal_message_post_length;
const minLen = this.siteSettings.min_personal_message_post_length;
if (len === 0) {
return I18n.t("flagging.custom_message.at_least", { count: minLen });
} else if (len < minLen) {