diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index 70e54aef..90114c0e 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -84,6 +84,7 @@ class NoteList extends React.Component { if (targetIndex > -1) { let list = this.refs.root let item = list.childNodes[targetIndex] + if (item == null) return false let overflowBelow = item.offsetTop + item.clientHeight - list.clientHeight - list.scrollTop > 0 if (overflowBelow) { diff --git a/browser/main/TopBar/index.js b/browser/main/TopBar/index.js index 6cf478ad..f6433581 100644 --- a/browser/main/TopBar/index.js +++ b/browser/main/TopBar/index.js @@ -63,8 +63,9 @@ class TopBar extends React.Component { } getOptions () { - let { notes } = this.props + let { data } = this.props let { search } = this.state + let notes = data.noteMap.map((note) => note) if (search.trim().length === 0) return [] let searchBlocks = search.split(' ') searchBlocks.forEach((block) => { @@ -135,14 +136,14 @@ class TopBar extends React.Component { } render () { - let { config, style, storages } = this.props + let { config, style, data } = this.props let searchOptionList = this.getOptions() .map((note) => { - let storage = _.find(storages, {key: note.storage}) + let storage = data.storageMap.get(note.storage) let folder = _.find(storage.folders, {key: note.folder}) return