mirror of
https://github.com/flarum/framework.git
synced 2025-04-26 06:34:06 +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.
|
// Add tag labels to each discussion in the discussion list.
|
||||||
extend(DiscussionList.prototype, 'infoItems', function(items, discussion) {
|
extend(DiscussionList.prototype, 'infoItems', function(items, discussion) {
|
||||||
var tags = discussion.tags();
|
var tags = discussion.tags();
|
||||||
if (tags && tags.length) {
|
if (tags) {
|
||||||
items.add('tags', tagsLabel(tags.filter(tag => tag.slug() !== this.props.params.tags)), {first: true});
|
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