Skip to content

Commit 2831b0b

Browse files
committed
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
1 parent 32e22dd commit 2831b0b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

browser/main/SideNav/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ class SideNav extends React.Component {
148148
const relatedTags = this.getRelatedTags(this.getActiveTags(location.pathname), data.noteMap)
149149
let tagList = _.sortBy(data.tagNoteMap.map(
150150
(tag, name) => ({ name, size: tag.size, related: relatedTags.has(name) })
151-
), ['name'])
151+
), ['name']).filter(
152+
tag => tag.size > 0
153+
)
152154
if (config.sortTagsBy === 'COUNTER') {
153155
tagList = _.sortBy(tagList, item => (0 - item.size))
154156
}

0 commit comments

Comments
 (0)