This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/routes/user-notifications.js.es6
Mark VanLandingham e5311ab645 DEV: Import DiscourseRoute rather than Discourse.Route (#8225)
* DEV: Discourse.Route -> DiscourseRoute with import

* ran prettier on all routes

* prettiered one more file
2019-10-22 09:46:10 -04:00

33 lines
799 B
JavaScript

import DiscourseRoute from "discourse/routes/discourse";
import ViewingActionType from "discourse/mixins/viewing-action-type";
export default DiscourseRoute.extend(ViewingActionType, {
renderTemplate() {
this.render("user/notifications");
},
actions: {
didTransition() {
this.controllerFor("user-notifications")._showFooter();
return true;
}
},
model() {
const username = this.modelFor("user").get("username");
if (
this.get("currentUser.username") === username ||
this.get("currentUser.admin")
) {
return this.store.find("notification", { username });
}
},
setupController(controller, model) {
controller.set("model", model);
controller.set("user", this.modelFor("user"));
this.viewingActionType(-1);
}
});