discourse/app/assets/javascripts/admin/addon/controllers/admin-badges.js

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

24 lines
606 B
JavaScript
Raw Normal View History

import Controller from "@ember/controller";
import { inject as service } from "@ember/service";
import { tracked } from "@glimmer/tracking";
export default class AdminBadgesController extends Controller {
@service router;
// Set by the route
@tracked badgeGroupings;
@tracked badgeTypes;
@tracked protectedSystemFields;
@tracked badgeTriggers;
get selectedRoute() {
const currentRoute = this.router.currentRouteName;
const indexRoute = "adminBadges.index";
if (currentRoute === indexRoute) {
return "adminBadges.show";
} else {
return currentRoute;
}
}
}