1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 07:57:46 +02:00

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

@@ -21583,8 +21583,8 @@ System.register('flarum/models/Discussion', ['flarum/Model', 'flarum/utils/compu
hideTime: Model.attribute('hideTime', Model.transformDate),
hideUser: Model.hasOne('hideUser'),
isHidden: computed('hideTime', 'commentsCount', function (hideTime, commentsCount) {
return !!hideTime || commentsCount === 0;
isHidden: computed('hideTime', function (hideTime) {
return !!hideTime;
}),
canReply: Model.attribute('canReply'),