mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
Remove pinnedNotes from Folder
This commit is contained in:
@@ -293,8 +293,8 @@ class NoteList extends React.Component {
|
|||||||
|
|
||||||
let folder = _.find(storage.folders, {key: folderKey})
|
let folder = _.find(storage.folders, {key: folderKey})
|
||||||
if (folder === undefined) return unorderedNotes
|
if (folder === undefined) return unorderedNotes
|
||||||
const pinnedNotes = unorderedNotes.filter((el) => {
|
const pinnedNotes = unorderedNotes.filter((note) => {
|
||||||
return el.isPinned
|
return note.isPinned
|
||||||
})
|
})
|
||||||
|
|
||||||
return pinnedNotes.concat(unorderedNotes)
|
return pinnedNotes.concat(unorderedNotes)
|
||||||
|
|||||||
@@ -44,8 +44,7 @@ function createFolder (storageKey, input) {
|
|||||||
let newFolder = {
|
let newFolder = {
|
||||||
key,
|
key,
|
||||||
color: input.color,
|
color: input.color,
|
||||||
name: input.name,
|
name: input.name
|
||||||
pinnedNotes: []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
storage.folders.push(newFolder)
|
storage.folders.push(newFolder)
|
||||||
|
|||||||
@@ -45,11 +45,6 @@ function updateFolder (storageKey, folderKey, input) {
|
|||||||
targetFolder.name = input.name
|
targetFolder.name = input.name
|
||||||
targetFolder.color = input.color
|
targetFolder.color = input.color
|
||||||
// For compativility
|
// 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']))
|
CSON.writeFileSync(path.join(storage.path, 'boostnote.json'), _.pick(storage, ['folders', 'version']))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user