Make discussion "hidden" state more explicit

Previously a discussion was classified on the front-end as "hidden" if it had zero posts. This was technically a correct statement as the discussion would not be visible to the public... but it also meant that a discussion with zero posts (like one awaiting approval) was impossible for the OP to delete/hide (i.e. indicate that they made a mistake and they don't want the discussion to be approved).
This commit is contained in:
Toby Zerner
2016-05-28 09:43:21 +09:30
parent a380424de4
commit 2d5a7ce064
4 changed files with 35 additions and 29 deletions

View File

@ -30,7 +30,7 @@ Object.assign(Discussion.prototype, {
hideTime: Model.attribute('hideTime', Model.transformDate),
hideUser: Model.hasOne('hideUser'),
isHidden: computed('hideTime', 'commentsCount', (hideTime, commentsCount) => !!hideTime || commentsCount === 0),
isHidden: computed('hideTime', hideTime => !!hideTime),
canReply: Model.attribute('canReply'),
canRename: Model.attribute('canRename'),