From 38c1d9ef6673b561db611d29b88acdba107452c2 Mon Sep 17 00:00:00 2001 From: thecodrr Date: Fri, 7 Feb 2020 04:21:54 +0500 Subject: [PATCH] fix: tags count not decreasing on untag/uncolor --- packages/core/collections/tags.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/collections/tags.js b/packages/core/collections/tags.js index 5a47926a4..2f436b59d 100644 --- a/packages/core/collections/tags.js +++ b/packages/core/collections/tags.js @@ -28,10 +28,10 @@ export default class Tags { if (!id || id.trim().length <= 0) return; let tag = this.collection.getItem(id); if (!tag) return; - if (tag.count <= 1) { + tag.count--; + if (tag.count === 0) { await this.collection.removeItem(id); } else { - tag.count--; await this.collection.addItem(tag); } }