diff --git a/browser/main/SideNav/index.js b/browser/main/SideNav/index.js index 0dd34989..65f76691 100644 --- a/browser/main/SideNav/index.js +++ b/browser/main/SideNav/index.js @@ -19,8 +19,8 @@ import {SortableContainer} from 'react-sortable-hoc' import i18n from 'browser/lib/i18n' import context from 'browser/lib/context' -function findOne (haystack, arr) { - return arr.some(v => haystack.indexOf(v) >= 0) +function matchActiveTags (tags, activeTags) { + return _.every(activeTags, v => tags.indexOf(v) >= 0) } class SideNav extends React.Component { @@ -158,7 +158,7 @@ class SideNav extends React.Component { if (config.ui.enableLiveNoteCounts && activeTags.length !== 0) { const notesTags = data.noteMap.map(note => note.tags) tagList = tagList.map(tag => { - tag.size = notesTags.filter(tags => tags.includes(tag.name) && findOne(tags, activeTags)).length + tag.size = notesTags.filter(tags => tags.includes(tag.name) && matchActiveTags(tags, activeTags)).length return tag }) }