1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Change order for pinned notes on /home, /trashed, /searched or /starred

This commit is contained in:
asmsuechan
2017-10-13 16:33:44 +09:00
parent 2003bea3cf
commit d274563b2c

View File

@@ -469,9 +469,10 @@ class NoteList extends React.Component {
: config.sortBy === 'ALPHABETICAL' : config.sortBy === 'ALPHABETICAL'
? sortByAlphabetical ? sortByAlphabetical
: sortByUpdatedAt : sortByUpdatedAt
const sortedNotes = this.getNotes().sort(sortFunc) const sortedNotes = location.pathname.match(/\/home|\/starred|\/trash/)
this.notes = notes = this.sortByPin(sortedNotes) ? this.getNotes().sort(sortFunc)
.filter((note) => { : this.sortByPin(this.getNotes().sort(sortFunc))
this.notes = notes = sortedNotes.filter((note) => {
// this is for the trash box // this is for the trash box
if (note.isTrashed !== true || location.pathname === '/trashed') return true if (note.isTrashed !== true || location.pathname === '/trashed') return true
}) })