mirror of
https://github.com/discourse/discourse.git
synced 2025-04-02 01:55:59 +08:00
REFACTOR: Remove a few Discourse.Site
globals
This commit is contained in:
parent
afadf361b3
commit
f49494b0bf
@ -6,6 +6,7 @@ import { on } from "discourse-common/utils/decorators";
|
|||||||
import PermissionType from "discourse/models/permission-type";
|
import PermissionType from "discourse/models/permission-type";
|
||||||
import { NotificationLevels } from "discourse/lib/notification-levels";
|
import { NotificationLevels } from "discourse/lib/notification-levels";
|
||||||
import deprecated from "discourse-common/lib/deprecated";
|
import deprecated from "discourse-common/lib/deprecated";
|
||||||
|
import Site from "discourse/models/site";
|
||||||
|
|
||||||
const Category = RestModel.extend({
|
const Category = RestModel.extend({
|
||||||
permissions: null,
|
permissions: null,
|
||||||
@ -214,7 +215,7 @@ const Category = RestModel.extend({
|
|||||||
|
|
||||||
@discourseComputed("id")
|
@discourseComputed("id")
|
||||||
isUncategorizedCategory(id) {
|
isUncategorizedCategory(id) {
|
||||||
return id === Discourse.Site.currentProp("uncategorized_category_id");
|
return id === Site.currentProp("uncategorized_category_id");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -226,7 +227,7 @@ Category.reopenClass({
|
|||||||
_uncategorized ||
|
_uncategorized ||
|
||||||
Category.list().findBy(
|
Category.list().findBy(
|
||||||
"id",
|
"id",
|
||||||
Discourse.Site.currentProp("uncategorized_category_id")
|
Site.currentProp("uncategorized_category_id")
|
||||||
);
|
);
|
||||||
return _uncategorized;
|
return _uncategorized;
|
||||||
},
|
},
|
||||||
@ -250,15 +251,15 @@ Category.reopenClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
list() {
|
list() {
|
||||||
return Discourse.Site.currentProp("categoriesList");
|
return Site.currentProp("categoriesList");
|
||||||
},
|
},
|
||||||
|
|
||||||
listByActivity() {
|
listByActivity() {
|
||||||
return Discourse.Site.currentProp("sortedCategories");
|
return Site.currentProp("sortedCategories");
|
||||||
},
|
},
|
||||||
|
|
||||||
_idMap() {
|
_idMap() {
|
||||||
return Discourse.Site.currentProp("categoriesById");
|
return Site.currentProp("categoriesById");
|
||||||
},
|
},
|
||||||
|
|
||||||
findSingleBySlug(slug) {
|
findSingleBySlug(slug) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user