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
Change order for pinned notes on /home, /trashed, /searched or /starred
  • Loading branch information
asmsuechan committed Oct 13, 2017
commit d274563b2c2e10bfe0f668fe5aa708c4e2adf4ba
13 changes: 7 additions & 6 deletions browser/main/NoteList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,13 @@ class NoteList extends React.Component {
: config.sortBy === 'ALPHABETICAL'
? sortByAlphabetical
: sortByUpdatedAt
const sortedNotes = this.getNotes().sort(sortFunc)
this.notes = notes = this.sortByPin(sortedNotes)
.filter((note) => {
// this is for the trash box
if (note.isTrashed !== true || location.pathname === '/trashed') return true
})
const sortedNotes = location.pathname.match(/\/home|\/starred|\/trash/)
? this.getNotes().sort(sortFunc)
: this.sortByPin(this.getNotes().sort(sortFunc))
this.notes = notes = sortedNotes.filter((note) => {
// this is for the trash box
if (note.isTrashed !== true || location.pathname === '/trashed') return true
})

let noteList = notes
.map(note => {
Expand Down