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/models/user-action-stat.js.es6
2018-06-15 17:03:24 +02:00

24 lines
697 B
JavaScript

import RestModel from "discourse/models/rest";
import UserAction from "discourse/models/user-action";
import { i18n } from "discourse/lib/computed";
export default RestModel.extend({
isPM: function() {
const actionType = this.get("action_type");
return (
actionType === UserAction.TYPES.messages_sent ||
actionType === UserAction.TYPES.messages_received
);
}.property("action_type"),
description: i18n("action_type", "user_action_groups.%@"),
isResponse: function() {
const actionType = this.get("action_type");
return (
actionType === UserAction.TYPES.replies ||
actionType === UserAction.TYPES.quotes
);
}.property("action_type")
});