Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Remove unnecessary lines
  • Loading branch information
asmsuechan committed Oct 13, 2017
commit 2003bea3cff238ed11f0ffe5dbc1c66f75144b80
13 changes: 1 addition & 12 deletions browser/main/NoteList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class NoteList extends React.Component {
if (location.pathname.match(/\/searched/)) {
const searchInputText = document.getElementsByClassName('searchInput')[0].value
if (searchInputText === '') {
return this.contextNotes
return this.sortByPin(this.contextNotes)
}
return searchFromNotes(this.contextNotes, searchInputText)
}
Expand Down Expand Up @@ -285,17 +285,6 @@ class NoteList extends React.Component {
}

sortByPin (unorderedNotes) {
const { data, params, location } = this.props
const storageKey = params.storageKey
const folderKey = params.folderKey
const storage = data.storageMap.get(storageKey)
if (location.pathname.match(/\/home|\/starred|\/trash|\/search/)) {
return unorderedNotes
}
if (storage === undefined) return []

const folder = _.find(storage.folders, {key: folderKey})
if (folder === undefined) return unorderedNotes
const pinnedNotes = unorderedNotes.filter((note) => {
return note.isPinned
})
Expand Down