mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
feature tag search
This commit is contained in:
@@ -229,7 +229,7 @@ class NoteList extends React.Component {
|
||||
let { data, params, location } = this.props
|
||||
let { router } = this.context
|
||||
|
||||
if (location.pathname.match(/\/home/)) {
|
||||
if (location.pathname.match(/\/home/) || location.pathname.match(/\alltags/)) {
|
||||
const allNotes = data.noteMap.map((note) => note)
|
||||
this.contextNotes = allNotes
|
||||
return allNotes
|
||||
@@ -255,6 +255,14 @@ class NoteList extends React.Component {
|
||||
return trashedNotes
|
||||
}
|
||||
|
||||
if (location.pathname.match(/\/tags/)) {
|
||||
return data.noteMap.map(note => {
|
||||
return note
|
||||
}).filter(note => {
|
||||
return note.tags.includes(params.tagname)
|
||||
})
|
||||
}
|
||||
|
||||
return this.getContextNotes()
|
||||
}
|
||||
|
||||
@@ -454,7 +462,6 @@ class NoteList extends React.Component {
|
||||
}
|
||||
|
||||
render () {
|
||||
console.log(this.props)
|
||||
let { location, notes, config, dispatch } = this.props
|
||||
let sortFunc = config.sortBy === 'CREATED_AT'
|
||||
? sortByCreatedAt
|
||||
|
||||
Reference in New Issue
Block a user