Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion browser/main/NoteList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ class NoteList extends React.Component {

getNotes () {
let { data, params, location } = this.props
let { router } = this.context

if (location.pathname.match(/\/home/)) {
return data.noteMap.map((note) => note)
Expand All @@ -214,7 +215,11 @@ class NoteList extends React.Component {
}

if (location.pathname.match(/\/searched/)) {
return searchFromNotes(this.props.data, document.getElementsByClassName('searchInput')[0].value)
const searchInputText = document.getElementsByClassName('searchInput')[0].value
if (searchInputText === '') {
router.push('/home')
}
return searchFromNotes(this.props.data, searchInputText)
}

let storageKey = params.storageKey
Expand Down