mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 18:35:11 +08:00
011ba5b9f6
Per https://deprecations.emberjs.com/v3.x/#toc_routing-transition-methods We are upgrading all `this.transitionTo` calls on routes to directly call the router service (`this.router.transitionTo`)
15 lines
363 B
JavaScript
15 lines
363 B
JavaScript
import Route from "@ember/routing/route";
|
|
import { inject as service } from "@ember/service";
|
|
|
|
export default class AdminCustomizeIndexRoute extends Route {
|
|
@service router;
|
|
|
|
beforeModel() {
|
|
if (this.currentUser.admin) {
|
|
this.router.transitionTo("adminCustomizeThemes");
|
|
} else {
|
|
this.router.transitionTo("adminWatchedWords");
|
|
}
|
|
}
|
|
}
|