REFACTOR: Remove `Discourse.SiteSettings` from some controllers
This commit is contained in:
parent
17bccbb52f
commit
f83c383177
|
@ -93,7 +93,7 @@ export default Controller.extend(ModalFunctionality, {
|
||||||
if (selected.get("is_custom_flag")) {
|
if (selected.get("is_custom_flag")) {
|
||||||
const len = this.get("message.length") || 0;
|
const len = this.get("message.length") || 0;
|
||||||
return (
|
return (
|
||||||
len >= Discourse.SiteSettings.min_personal_message_post_length &&
|
len >= this.siteSettings.min_personal_message_post_length &&
|
||||||
len <= MAX_MESSAGE_LENGTH
|
len <= MAX_MESSAGE_LENGTH
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ export default Controller.extend(BulkTopicSelection, FilterModeMixin, {
|
||||||
|
|
||||||
@discourseComputed("category")
|
@discourseComputed("category")
|
||||||
showTagFilter() {
|
showTagFilter() {
|
||||||
return Discourse.SiteSettings.show_filter_by_tag;
|
return this.siteSettings.show_filter_by_tag;
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed("additionalTags", "category", "tag.id")
|
@discourseComputed("additionalTags", "category", "tag.id")
|
||||||
|
|
|
@ -21,7 +21,6 @@ export default Controller.extend({
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
||||||
this.set("searchTerm", "");
|
this.set("searchTerm", "");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -141,8 +140,7 @@ export default Controller.extend({
|
||||||
model.invites.pushObjects(invite_model.invites);
|
model.invites.pushObjects(invite_model.invites);
|
||||||
if (
|
if (
|
||||||
invite_model.invites.length === 0 ||
|
invite_model.invites.length === 0 ||
|
||||||
invite_model.invites.length <
|
invite_model.invites.length < this.siteSettings.invites_per_page
|
||||||
Discourse.SiteSettings.invites_per_page
|
|
||||||
) {
|
) {
|
||||||
this.set("canLoadMore", false);
|
this.set("canLoadMore", false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@ export default Controller.extend(CanCheckEmails, {
|
||||||
|
|
||||||
@discourseComputed("model.badge_count")
|
@discourseComputed("model.badge_count")
|
||||||
showBadges(badgeCount) {
|
showBadges(badgeCount) {
|
||||||
return Discourse.SiteSettings.enable_badges && badgeCount > 0;
|
return this.siteSettings.enable_badges && badgeCount > 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed()
|
@discourseComputed()
|
||||||
|
|
Loading…
Reference in New Issue