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

Star a note

This commit is contained in:
Dick Choi
2016-05-29 13:08:02 +09:00
parent eb210e9072
commit 5a26fc812d
7 changed files with 205 additions and 4 deletions

View File

@@ -441,6 +441,27 @@ class Repository {
})
}
starNote (noteKey) {
let note = _.find(this.notes, {key: noteKey})
if (note != null) {
let json = this.json
json.starred.push(noteKey)
return this.saveJSON(json)
}
}
unstarNote (noteKey) {
let note = _.find(this.notes, {key: noteKey})
if (note != null) {
let json = this.json
json.starred = json.starred
.filter((starredKey) => starredKey !== noteKey)
return this.saveJSON(json)
}
}
removeNote (noteKey) {
let noteIndex = _.findIndex(this.notes, {key: noteKey})
@@ -473,7 +494,8 @@ class Repository {
key: keygen(),
name: 'general',
color: this.randomColor()
}]
}],
starred: []
}, override)
}