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

Remove pinnedNotes from Folder

This commit is contained in:
asmsuechan
2017-10-11 13:35:24 +09:00
parent 8fd4deb3eb
commit 0ccb465288
3 changed files with 3 additions and 9 deletions

View File

@@ -293,8 +293,8 @@ class NoteList extends React.Component {
let folder = _.find(storage.folders, {key: folderKey})
if (folder === undefined) return unorderedNotes
const pinnedNotes = unorderedNotes.filter((el) => {
return el.isPinned
const pinnedNotes = unorderedNotes.filter((note) => {
return note.isPinned
})
return pinnedNotes.concat(unorderedNotes)

View File

@@ -44,8 +44,7 @@ function createFolder (storageKey, input) {
let newFolder = {
key,
color: input.color,
name: input.name,
pinnedNotes: []
name: input.name
}
storage.folders.push(newFolder)

View File

@@ -45,11 +45,6 @@ function updateFolder (storageKey, folderKey, input) {
targetFolder.name = input.name
targetFolder.color = input.color
// For compativility
if (targetFolder.pinnedNotes) {
targetFolder.pinnedNotes.push(input.pinnedNote)
} else {
targetFolder.pinnedNotes = [input.pinnedNote]
}
CSON.writeFileSync(path.join(storage.path, 'boostnote.json'), _.pick(storage, ['folders', 'version']))