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

prevent duplication of starred

This commit is contained in:
Dick Choi
2016-05-29 13:52:17 +09:00
parent 999d4633ab
commit 431ac5a403
2 changed files with 4 additions and 0 deletions

View File

@@ -446,6 +446,7 @@ class Repository {
if (note != null) {
let json = this.json
json.starred.push(noteKey)
json.starred = _.uniq(json.starred)
return this.saveJSON(json)
}
@@ -457,6 +458,7 @@ class Repository {
let json = this.json
json.starred = json.starred
.filter((starredKey) => starredKey !== noteKey)
json.starred = _.uniq(json.starred)
return this.saveJSON(json)
}