mirror of
https://github.com/flarum/framework.git
synced 2024-11-23 23:45:17 +08:00
Give the hidden/trash badge precedence over the awaiting approval badge
Given flarum/core@2d5a7ce, the hidden badge will no longer display for discussions awaiting approval – it will only display if the discussion has *actually* been marked as deleted by the OP. Thus, this information should have precedence. (There isn't much point in displaying both badges, I don't think.)
This commit is contained in:
parent
0bd3c16084
commit
badd03f3a3
|
@ -31,8 +31,7 @@ System.register('flarum/approval/main', ['flarum/extend', 'flarum/app', 'flarum/
|
|||
Discussion.prototype.isApproved = Discussion.attribute('isApproved');
|
||||
|
||||
extend(Discussion.prototype, 'badges', function (items) {
|
||||
if (!this.isApproved()) {
|
||||
items.remove('hidden');
|
||||
if (!this.isApproved() && !items.has('hidden')) {
|
||||
items.add('awaitingApproval', m(Badge, { type: 'awaitingApproval', icon: 'gavel', label: app.translator.trans('flarum-approval.forum.badge.awaiting_approval_tooltip') }));
|
||||
}
|
||||
});
|
||||
|
|
|
@ -13,8 +13,7 @@ app.initializers.add('flarum-approval', () => {
|
|||
Discussion.prototype.isApproved = Discussion.attribute('isApproved');
|
||||
|
||||
extend(Discussion.prototype, 'badges', function(items) {
|
||||
if (!this.isApproved()) {
|
||||
items.remove('hidden');
|
||||
if (!this.isApproved() && !items.has('hidden')) {
|
||||
items.add('awaitingApproval', <Badge type="awaitingApproval" icon="gavel" label={app.translator.trans('flarum-approval.forum.badge.awaiting_approval_tooltip')}/>);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user