From 7107777df3910871fbae7f585261473bafbc4f5d Mon Sep 17 00:00:00 2001 From: Dick Choi Date: Sat, 15 Oct 2016 00:20:56 +0900 Subject: [PATCH] fix NoteList bug in Finder --- browser/finder/NoteList.js | 1 - browser/finder/index.js | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/browser/finder/NoteList.js b/browser/finder/NoteList.js index a51b8cf5..30d0163a 100644 --- a/browser/finder/NoteList.js +++ b/browser/finder/NoteList.js @@ -57,7 +57,6 @@ class NoteList extends React.Component { let { storageMap, notes, index } = this.props let notesList = notes - .sort((a, b) => new Date(b.updatedAt) - new Date(a.updatedAt)) .slice(0, 10 + 10 * this.state.range) .map((note, _index) => { let storage = storageMap[note.storage] diff --git a/browser/finder/index.js b/browser/finder/index.js index c9f0bc04..12275fed 100644 --- a/browser/finder/index.js +++ b/browser/finder/index.js @@ -266,6 +266,8 @@ class FinderMain extends React.Component { let needle = new RegExp(_.escapeRegExp(search.trim()), 'i') notes = notes.filter((note) => note.title.match(needle)) } + notes = notes + .sort((a, b) => new Date(b.updatedAt) - new Date(a.updatedAt)) let activeNote = notes[this.state.index] this.noteCount = notes.length