mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
Make context-search work
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
|
||||||
export default function searchFromNotes (data, search) {
|
export default function searchFromNotes (notes, search) {
|
||||||
let notes = data.noteMap.map((note) => note)
|
|
||||||
if (search.trim().length === 0) return []
|
if (search.trim().length === 0) return []
|
||||||
let searchBlocks = search.split(' ')
|
let searchBlocks = search.split(' ')
|
||||||
searchBlocks.forEach((block) => {
|
searchBlocks.forEach((block) => {
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ class NoteList extends React.Component {
|
|||||||
if (searchInputText === '') {
|
if (searchInputText === '') {
|
||||||
router.push('/home')
|
router.push('/home')
|
||||||
}
|
}
|
||||||
return searchFromNotes(this.props.data, searchInputText)
|
return searchFromNotes(this.notes, searchInputText)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (location.pathname.match(/\/trashed/)) {
|
if (location.pathname.match(/\/trashed/)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user