1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Only showing the tags that size > 0

No meaning to show the tag that has empty List
The tag which is only used in the note(s) in the Trash, tags.size becomes zero. In order to support this case, filtering tagList is needed
This commit is contained in:
yosmoc
2018-04-26 23:52:05 +02:00
parent 32e22dd507
commit 2831b0bd2a

View File

@@ -148,7 +148,9 @@ class SideNav extends React.Component {
const relatedTags = this.getRelatedTags(this.getActiveTags(location.pathname), data.noteMap)
let tagList = _.sortBy(data.tagNoteMap.map(
(tag, name) => ({ name, size: tag.size, related: relatedTags.has(name) })
), ['name'])
), ['name']).filter(
tag => tag.size > 0
)
if (config.sortTagsBy === 'COUNTER') {
tagList = _.sortBy(tagList, item => (0 - item.size))
}