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

Fix starred item count

* Deleting a starred item will now update the starred count in the side nav. (delete from starred set)
* Restoring a starred item will add it the the starred set again.

Fix: #1326
This commit is contained in:
Niko Caron
2017-12-23 18:17:48 -04:00
parent 16d264ebfa
commit bf781c6b50

View File

@@ -87,8 +87,13 @@ function data (state = defaultDataMap(), action) {
state.trashedSet = new Set(state.trashedSet)
if (note.isTrashed) {
state.trashedSet.add(uniqueKey)
state.starredSet.delete(uniqueKey)
} else {
state.trashedSet.delete(uniqueKey)
if (note.isStarred) {
state.starredSet.add(uniqueKey)
}
}
}