mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 07:26:04 +08:00
3eb8046dde
# Context This PR was originally implemented in https://github.com/discourse/discourse/pull/22645 then reverted in https://github.com/discourse/discourse/pull/22693. We protect from aborted transition when _awaiting_ on `replaceWith` by utilizing [followRedirects()](https://api.emberjs.com/ember/5.1/classes/Transition/methods/followRedirects?anchor=followRedirects) # Description Per https://deprecations.emberjs.com/v3.x/#toc_routing-transition-methods We are upgrading all `this.replaceWith` calls on routes to directly call the router service (`this.router.replaceWith`)
14 lines
350 B
JavaScript
14 lines
350 B
JavaScript
import DiscourseRoute from "discourse/routes/discourse";
|
|
import { inject as service } from "@ember/service";
|
|
|
|
export default class AdminWatchedWordsIndexRoute extends DiscourseRoute {
|
|
@service router;
|
|
|
|
beforeModel() {
|
|
this.router.replaceWith(
|
|
"adminWatchedWords.action",
|
|
this.modelFor("adminWatchedWords")[0].nameKey
|
|
);
|
|
}
|
|
}
|