mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
fix: tags count not decreasing on untag/uncolor
This commit is contained in:
@@ -28,10 +28,10 @@ export default class Tags {
|
|||||||
if (!id || id.trim().length <= 0) return;
|
if (!id || id.trim().length <= 0) return;
|
||||||
let tag = this.collection.getItem(id);
|
let tag = this.collection.getItem(id);
|
||||||
if (!tag) return;
|
if (!tag) return;
|
||||||
if (tag.count <= 1) {
|
tag.count--;
|
||||||
|
if (tag.count === 0) {
|
||||||
await this.collection.removeItem(id);
|
await this.collection.removeItem(id);
|
||||||
} else {
|
} else {
|
||||||
tag.count--;
|
|
||||||
await this.collection.addItem(tag);
|
await this.collection.addItem(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user