discourse/app/assets/javascripts/admin/addon/routes/admin-site-settings-index.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
520 B
JavaScript
Raw Normal View History

2015-03-03 01:12:19 +08:00
/**
Handles when you click the Site Settings tab in admin, but haven't
chosen a category. It will redirect to the first category.
**/
import { service } from "@ember/service";
import DiscourseRoute from "discourse/routes/discourse";
export default class AdminSiteSettingsIndexRoute extends DiscourseRoute {
@service router;
2015-03-03 01:12:19 +08:00
beforeModel() {
this.router.replaceWith(
2015-03-03 01:12:19 +08:00
"adminSiteSettingsCategory",
this.controllerFor("adminSiteSettings").get("visibleSiteSettings")[0]
.nameKey
2015-03-03 01:12:19 +08:00
);
}
}