From 2831b0bd2af09da58221fadcf668fcd0c51f8ca6 Mon Sep 17 00:00:00 2001 From: yosmoc Date: Thu, 26 Apr 2018 23:52:05 +0200 Subject: [PATCH] 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 --- browser/main/SideNav/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/browser/main/SideNav/index.js b/browser/main/SideNav/index.js index 6b53478e..0159293a 100644 --- a/browser/main/SideNav/index.js +++ b/browser/main/SideNav/index.js @@ -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)) }