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:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user