File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,9 @@ class SideNav extends React.Component {
148
148
const relatedTags = this . getRelatedTags ( this . getActiveTags ( location . pathname ) , data . noteMap )
149
149
let tagList = _ . sortBy ( data . tagNoteMap . map (
150
150
( tag , name ) => ( { name, size : tag . size , related : relatedTags . has ( name ) } )
151
- ) , [ 'name' ] )
151
+ ) , [ 'name' ] ) . filter (
152
+ tag => tag . size > 0
153
+ )
152
154
if ( config . sortTagsBy === 'COUNTER' ) {
153
155
tagList = _ . sortBy ( tagList , item => ( 0 - item . size ) )
154
156
}
Original file line number Diff line number Diff line change @@ -88,9 +88,27 @@ function data (state = defaultDataMap(), action) {
88
88
if ( note . isTrashed ) {
89
89
state . trashedSet . add ( uniqueKey )
90
90
state . starredSet . delete ( uniqueKey )
91
+
92
+ note . tags . forEach ( tag => {
93
+ let tagNoteList = state . tagNoteMap . get ( tag )
94
+ if ( tagNoteList != null ) {
95
+ tagNoteList = new Set ( tagNoteList )
96
+ tagNoteList . delete ( uniqueKey )
97
+ state . tagNoteMap . set ( tag , tagNoteList )
98
+ }
99
+ } )
91
100
} else {
92
101
state . trashedSet . delete ( uniqueKey )
93
102
103
+ note . tags . forEach ( tag => {
104
+ let tagNoteList = state . tagNoteMap . get ( tag )
105
+ if ( tagNoteList != null ) {
106
+ tagNoteList = new Set ( tagNoteList )
107
+ tagNoteList . add ( uniqueKey )
108
+ state . tagNoteMap . set ( tag , tagNoteList )
109
+ }
110
+ } )
111
+
94
112
if ( note . isStarred ) {
95
113
state . starredSet . add ( uniqueKey )
96
114
}
You can’t perform that action at this time.
0 commit comments