DEV: migrate routes to the new @action pattern (#15435)

After this fix we have only two routes that use the old "actions:" pattern:
- route:application
- route:discourse

I'll migrate them soon.
This commit is contained in:
Andrei Prigorshnev 2022-01-05 13:08:06 +01:00 committed by GitHub
parent 21822cf0b7
commit 692ba188bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View File

@ -2,6 +2,7 @@ import UserAction from "discourse/models/user-action";
import UserActivityStreamRoute from "discourse/routes/user-activity-stream";
import { iconHTML } from "discourse-common/lib/icon-library";
import I18n from "I18n";
import { action } from "@ember/object";
export default UserActivityStreamRoute.extend({
userActionType: UserAction.TYPES["likes_given"],
@ -16,10 +17,9 @@ export default UserActivityStreamRoute.extend({
return { title, body };
},
actions: {
didTransition() {
this.controllerFor("application").set("showFooter", true);
return true;
},
@action
didTransition() {
this.controllerFor("application").set("showFooter", true);
return true;
},
});

View File

@ -1,6 +1,7 @@
import UserAction from "discourse/models/user-action";
import UserActivityStreamRoute from "discourse/routes/user-activity-stream";
import I18n from "I18n";
import { action } from "@ember/object";
export default UserActivityStreamRoute.extend({
userActionType: UserAction.TYPES["posts"],
@ -12,10 +13,9 @@ export default UserActivityStreamRoute.extend({
return { title, body };
},
actions: {
didTransition() {
this.controllerFor("application").set("showFooter", true);
return true;
},
@action
didTransition() {
this.controllerFor("application").set("showFooter", true);
return true;
},
});