mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 07:02:46 +08:00
FIX: use 'about.json' endpoint instead of using ember model to get the data.
This commit is contained in:
parent
d4c9ed68a9
commit
edec922803
|
@ -4,8 +4,8 @@ import { categoryLinkHTML } from "discourse/helpers/category-link";
|
||||||
import { on } from "@ember/object/evented";
|
import { on } from "@ember/object/evented";
|
||||||
import Mixin from "@ember/object/mixin";
|
import Mixin from "@ember/object/mixin";
|
||||||
import showModal from "discourse/lib/show-modal";
|
import showModal from "discourse/lib/show-modal";
|
||||||
import AboutRoute from "discourse/routes/about";
|
|
||||||
import { Promise } from "rsvp";
|
import { Promise } from "rsvp";
|
||||||
|
import { ajax } from "discourse/lib/ajax";
|
||||||
|
|
||||||
const CUSTOM_TYPES = [
|
const CUSTOM_TYPES = [
|
||||||
"bool",
|
"bool",
|
||||||
|
@ -151,22 +151,20 @@ export default Mixin.create({
|
||||||
const key = this.buffered.get("setting");
|
const key = this.buffered.get("setting");
|
||||||
|
|
||||||
if (defaultUserPreferences.includes(key)) {
|
if (defaultUserPreferences.includes(key)) {
|
||||||
AboutRoute.create()
|
ajax("/about.json").then(result => {
|
||||||
.model()
|
const controller = showModal("site-setting-default-categories", {
|
||||||
.then(result => {
|
model: {
|
||||||
const controller = showModal("site-setting-default-categories", {
|
count: result.about.stats.user_count,
|
||||||
model: {
|
key: key.replace(/_/g, " ")
|
||||||
count: result.stats.user_count,
|
},
|
||||||
key: key.replace(/_/g, " ")
|
admin: true
|
||||||
},
|
|
||||||
admin: true
|
|
||||||
});
|
|
||||||
|
|
||||||
controller.set("onClose", () => {
|
|
||||||
this.updateExistingUsers = controller.updateExistingUsers;
|
|
||||||
this.send("save");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
controller.set("onClose", () => {
|
||||||
|
this.updateExistingUsers = controller.updateExistingUsers;
|
||||||
|
this.send("save");
|
||||||
|
});
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.send("save");
|
this.send("save");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user