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() { parentCategories() {
return this.site return this.site
.get("categoriesList") .get("categoriesList")
.filter(c => c.level + 1 < Discourse.SiteSettings.max_category_nesting); .filter(c => c.level + 1 < this.siteSettings.max_category_nesting);
}, },
@discourseComputed( @discourseComputed(

View File

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