1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +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) { sortByPin (unorderedNotes) {
const pinnedNotes = unorderedNotes.filter((note) => { const pinnedNotes = []
return note.isPinned 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) { handleNoteClick (e, uniqueKey) {