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