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

Merge pull request #1033 from nathanielw/fix/pinned-next

Include each note only once when sorting by pin
This commit is contained in:
Kazu Yokomizo
2017-11-04 19:24:59 +09:00
committed by GitHub

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) {