mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 23:20:33 +08:00
19 lines
545 B
JavaScript
19 lines
545 B
JavaScript
import Controller from "@ember/controller";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
import { inject as service } from "@ember/service";
|
|
|
|
export default Controller.extend({
|
|
routing: service("-routing"),
|
|
|
|
@discourseComputed("routing.currentRouteName")
|
|
selectedRoute() {
|
|
const currentRoute = this.routing.currentRouteName;
|
|
const indexRoute = "adminBadges.index";
|
|
if (currentRoute === indexRoute) {
|
|
return "adminBadges.show";
|
|
} else {
|
|
return this.routing.currentRouteName;
|
|
}
|
|
},
|
|
});
|