1
0
mirror of https://github.com/flarum/core.git synced 2025-07-24 02:01:19 +02:00

Make unread discussion titles less overwhelming

This commit is contained in:
Toby Zerner
2015-09-08 10:27:50 +09:30
parent 76d0e7770c
commit ca53a63fd8
3 changed files with 8 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ export default class Discussion extends mixin(Model, {
readTime: Model.attribute('readTime', Model.transformDate),
readNumber: Model.attribute('readNumber'),
isUnread: computed('unreadCount', unreadCount => !!unreadCount),
isRead: computed('unreadCount', unreadCount => app.session.user && !unreadCount),
canReply: Model.attribute('canReply'),
canRename: Model.attribute('canRename'),
@@ -61,7 +62,7 @@ export default class Discussion extends mixin(Model, {
const user = app.session.user;
if (user && user.readTime() < this.lastTime()) {
return Math.max(0, this.lastPostNumber() - (this.readNumber() || 0))
return Math.max(0, this.lastPostNumber() - (this.readNumber() || 0));
}
return 0;