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

Add pinn to top

This commit is contained in:
asmsuechan
2017-10-13 13:10:39 +09:00
parent b890c59134
commit fe8045c51d
5 changed files with 83 additions and 4 deletions

View File

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

View File

@@ -44,6 +44,12 @@ function updateFolder (storageKey, folderKey, input) {
if (targetFolder == null) throw new Error('Target folder doesn\'t exist.')
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']))

View File

@@ -104,6 +104,7 @@ function updateNote (storageKey, noteKey, input) {
noteData.isStarred = false
noteData.isTrashed = false
noteData.tags = []
noteData.isPinned = false
}
if (noteData.type === 'SNIPPET_NOTE') {