REFACTOR: Simplify `willTransition`
This commit is contained in:
parent
7cc5c5bb31
commit
cf466f7b84
|
@ -1,6 +1,5 @@
|
|||
import getURL from "discourse-common/lib/get-url";
|
||||
import I18n from "I18n";
|
||||
import { once } from "@ember/runloop";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { setting } from "discourse/lib/computed";
|
||||
|
@ -58,11 +57,9 @@ const ApplicationRoute = DiscourseRoute.extend(OpenComposer, {
|
|||
this.documentTitle.setTitle(tokens.join(" - "));
|
||||
},
|
||||
|
||||
// Ember doesn't provider a router `willTransition` event so let's make one
|
||||
// We need an empty method here for Ember to fire the action properly on all routes.
|
||||
willTransition() {
|
||||
var router = getOwner(this).lookup("router:main");
|
||||
once(router, router.trigger, "willTransition");
|
||||
return this._super(...arguments);
|
||||
this._super(...arguments);
|
||||
},
|
||||
|
||||
postWasEnqueued(details) {
|
||||
|
|
Loading…
Reference in New Issue