mirror of
https://github.com/flarum/framework.git
synced 2025-04-25 14:14:03 +08:00
Don't show tags label if there are no tags to show
This commit is contained in:
parent
bec1f73c36
commit
d5b1d3bdb2
@ -10,8 +10,11 @@ export default function() {
|
||||
// Add tag labels to each discussion in the discussion list.
|
||||
extend(DiscussionList.prototype, 'infoItems', function(items, discussion) {
|
||||
var tags = discussion.tags();
|
||||
if (tags && tags.length) {
|
||||
items.add('tags', tagsLabel(tags.filter(tag => tag.slug() !== this.props.params.tags)), {first: true});
|
||||
if (tags) {
|
||||
tags = tags.filter(tag => tag.slug() !== this.props.params.tags);
|
||||
if (tags.length) {
|
||||
items.add('tags', tagsLabel(tags), {first: true});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user