1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Include each note only once when sorting by pin

Fixes #983
This commit is contained in:
Nathaniel Watson
2017-10-30 21:51:44 +13:00
parent 3f49a8a15a
commit e60f4f4a64

View File

@@ -285,11 +285,18 @@ class NoteList extends React.Component {
}
sortByPin (unorderedNotes) {
const pinnedNotes = unorderedNotes.filter((note) => {
return note.isPinned
const pinnedNotes = []
const unpinnedNotes = []
unorderedNotes.forEach((note) => {
if (note.isPinned) {
pinnedNotes.push(note)
} else {
unpinnedNotes.push(note)
}
})
return pinnedNotes.concat(unorderedNotes)
return pinnedNotes.concat(unpinnedNotes)
}
handleNoteClick (e, uniqueKey) {