Skip to content

Commit

Permalink
Change order for pinned notes on /home, /trashed, /searched or /starred
Browse files Browse the repository at this point in the history
  • Loading branch information
asmsuechan committed Oct 13, 2017
1 parent 2003bea commit d274563
Showing 1 changed file with 7 additions and 6 deletions.
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

0 comments on commit d274563

Please sign in to comment.