From f5d566b40cbc5252df32b43c0dfa568a16ca64f2 Mon Sep 17 00:00:00 2001 From: MuiseDestiny <2274466799@qq.com> Date: Sat, 19 Nov 2022 21:26:18 +0800 Subject: [PATCH] add: condition support --- src/items.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/items.js b/src/items.js index 71ced5f..d130c53 100644 --- a/src/items.js +++ b/src/items.js @@ -45,10 +45,10 @@ export default { isCondition = item.hasTag(_tag) } } - if (operation === "add" && !item.hasTag(tags[i])) { + if (operation === "add" && !item.hasTag(tags[i]) && isCondition) { item.addTag(tags[i], userTag ? 0 : 1); updateCount += 1; - } else if (operation === "remove" && item.hasTag(tags[i])) { + } else if (operation === "remove" && item.hasTag(tags[i]) && isCondition) { item.removeTag(tags[i]); updateCount += 1; } else if (operation === "change") {