mirror of
https://github.com/flarum/core.git
synced 2025-06-05 06:05:34 +02:00
Rename discussion.readTime
This commit is contained in:
parent
99e5013ac3
commit
9074f7e592
@ -23,7 +23,7 @@ Object.assign(Discussion.prototype, {
|
|||||||
posts: Model.hasMany('posts'),
|
posts: Model.hasMany('posts'),
|
||||||
mostRelevantPost: Model.hasOne('mostRelevantPost'),
|
mostRelevantPost: Model.hasOne('mostRelevantPost'),
|
||||||
|
|
||||||
readTime: Model.attribute('readTime', Model.transformDate),
|
lastReadAt: Model.attribute('lastReadAt', Model.transformDate),
|
||||||
readNumber: Model.attribute('readNumber'),
|
readNumber: Model.attribute('readNumber'),
|
||||||
isUnread: computed('unreadCount', unreadCount => !!unreadCount),
|
isUnread: computed('unreadCount', unreadCount => !!unreadCount),
|
||||||
isRead: computed('unreadCount', unreadCount => app.session.user && !unreadCount),
|
isRead: computed('unreadCount', unreadCount => app.session.user && !unreadCount),
|
||||||
|
@ -57,7 +57,7 @@ class DiscussionSerializer extends BasicDiscussionSerializer
|
|||||||
|
|
||||||
if ($state = $discussion->state) {
|
if ($state = $discussion->state) {
|
||||||
$attributes += [
|
$attributes += [
|
||||||
'readTime' => $this->formatDate($state->last_read_at),
|
'lastReadAt' => $this->formatDate($state->last_read_at),
|
||||||
'readNumber' => (int) $state->last_read_post_number
|
'readNumber' => (int) $state->last_read_post_number
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user