mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 14:49:57 +08:00
Replace Ember app with Mithril app
This commit is contained in:
19
js/lib/models/notification.js
Normal file
19
js/lib/models/notification.js
Normal file
@ -0,0 +1,19 @@
|
||||
import Model from 'flarum/model';
|
||||
import computed from 'flarum/utils/computed';
|
||||
|
||||
class Notification extends Model {}
|
||||
|
||||
Notification.prototype.id = Model.prop('id');
|
||||
Notification.prototype.contentType = Model.prop('contentType');
|
||||
Notification.prototype.subjectId = Model.prop('subjectId');
|
||||
Notification.prototype.content = Model.prop('content');
|
||||
Notification.prototype.time = Model.prop('time', Model.date);
|
||||
Notification.prototype.isRead = Model.prop('isRead');
|
||||
Notification.prototype.unreadCount = Model.prop('unreadCount');
|
||||
Notification.prototype.additionalUnreadCount = computed('unreadCount', unreadCount => Math.max(0, unreadCount - 1));
|
||||
|
||||
Notification.prototype.user = Model.one('user');
|
||||
Notification.prototype.sender = Model.one('sender');
|
||||
Notification.prototype.subject = Model.one('subject');
|
||||
|
||||
export default Notification;
|
Reference in New Issue
Block a user