DEV: Resolve transitionTo deprecation (#535)

This commit is contained in:
David Taylor 2023-12-01 16:06:09 +00:00 committed by GitHub
parent e1aabe0517
commit 9556df664c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1,8 +1,10 @@
import { inject as service } from "@ember/service";
import cookie from "discourse/lib/cookie";
import UserTopicListRoute from "discourse/routes/user-topic-list";
import I18n from "I18n";
export default class UserActivityAssigned extends UserTopicListRoute {
@service router;
templateName = "user-activity-assigned";
controllerName = "user-activity-assigned";
@ -12,7 +14,7 @@ export default class UserActivityAssigned extends UserTopicListRoute {
beforeModel() {
if (!this.currentUser) {
cookie("destination_url", window.location.href);
this.transitionTo("login");
this.router.transitionTo("login");
}
}