mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Merge pull request #1873 from yosmoc/trashed_notetag_exist
Not showing unassigned tag in taglist
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
@@ -88,9 +88,27 @@ function data (state = defaultDataMap(), action) {
|
||||
if (note.isTrashed) {
|
||||
state.trashedSet.add(uniqueKey)
|
||||
state.starredSet.delete(uniqueKey)
|
||||
|
||||
note.tags.forEach(tag => {
|
||||
let tagNoteList = state.tagNoteMap.get(tag)
|
||||
if (tagNoteList != null) {
|
||||
tagNoteList = new Set(tagNoteList)
|
||||
tagNoteList.delete(uniqueKey)
|
||||
state.tagNoteMap.set(tag, tagNoteList)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
state.trashedSet.delete(uniqueKey)
|
||||
|
||||
note.tags.forEach(tag => {
|
||||
let tagNoteList = state.tagNoteMap.get(tag)
|
||||
if (tagNoteList != null) {
|
||||
tagNoteList = new Set(tagNoteList)
|
||||
tagNoteList.add(uniqueKey)
|
||||
state.tagNoteMap.set(tag, tagNoteList)
|
||||
}
|
||||
})
|
||||
|
||||
if (note.isStarred) {
|
||||
state.starredSet.add(uniqueKey)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user