mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
DEV: Avoid unnecessary site-settings:main
lookups (#15006)
This commit is contained in:
parent
8dc9e0f4bd
commit
a102673522
@ -1,8 +1,4 @@
|
|||||||
import AdminUser from "admin/models/admin-user";
|
import AdminUser from "admin/models/admin-user";
|
||||||
// A service that can act as a bridge between the front end Discourse application
|
|
||||||
// and the admin application. Use this if you need front end code to access admin
|
|
||||||
// modules. Inject it optionally, and if it exists go to town!
|
|
||||||
|
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import { Promise } from "rsvp";
|
import { Promise } from "rsvp";
|
||||||
import Service from "@ember/service";
|
import Service from "@ember/service";
|
||||||
@ -12,14 +8,10 @@ import { getOwner } from "discourse-common/lib/get-owner";
|
|||||||
import { iconHTML } from "discourse-common/lib/icon-library";
|
import { iconHTML } from "discourse-common/lib/icon-library";
|
||||||
import showModal from "discourse/lib/show-modal";
|
import showModal from "discourse/lib/show-modal";
|
||||||
|
|
||||||
|
// A service that can act as a bridge between the front end Discourse application
|
||||||
|
// and the admin application. Use this if you need front end code to access admin
|
||||||
|
// modules. Inject it optionally, and if it exists go to town!
|
||||||
export default Service.extend({
|
export default Service.extend({
|
||||||
init() {
|
|
||||||
this._super(...arguments);
|
|
||||||
|
|
||||||
// TODO: Make `siteSettings` a service that can be injected
|
|
||||||
this.siteSettings = getOwner(this).lookup("site-settings:main");
|
|
||||||
},
|
|
||||||
|
|
||||||
showActionLogs(target, filters) {
|
showActionLogs(target, filters) {
|
||||||
const controller = getOwner(target).lookup(
|
const controller = getOwner(target).lookup(
|
||||||
"controller:adminLogs.staffActionLogs"
|
"controller:adminLogs.staffActionLogs"
|
||||||
|
@ -744,9 +744,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
categoriesTopicsList() {
|
categoriesTopicsList() {
|
||||||
const setting = this.container.lookup("site-settings:main")
|
switch (this.siteSettings.desktop_category_page_style) {
|
||||||
.desktop_category_page_style;
|
|
||||||
switch (setting) {
|
|
||||||
case "categories_with_featured_topics":
|
case "categories_with_featured_topics":
|
||||||
return $(".latest .featured-topic");
|
return $(".latest .featured-topic");
|
||||||
case "categories_and_latest_topics":
|
case "categories_and_latest_topics":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user