From 4264c2e2662efc9cb00d51f3862711ec32cf4532 Mon Sep 17 00:00:00 2001 From: Haka <76921756+Hakorr@users.noreply.github.com> Date: Fri, 23 Sep 2022 15:35:05 +0300 Subject: [PATCH] Revert changes to refreshTagsList --- ui/index.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/index.html b/ui/index.html index 903444d4..88457d35 100644 --- a/ui/index.html +++ b/ui/index.html @@ -1424,11 +1424,13 @@ function refreshTagsList() { editorModifierTagsList.appendChild(tag.element); tag.element.addEventListener('click', () => { - if (index !== -1) { - activeTags[index].originElement.classList.remove(activeCardClass); - activeTags[index].originElement.querySelector('.modifier-card-image-overlay').innerText = '+'; + let idx = activeTags.indexOf(tag); - activeTags.splice(index, 1); + if (idx !== -1) { + activeTags[idx].originElement.classList.remove(activeCardClass); + activeTags[idx].originElement.querySelector('.modifier-card-overlay').innerText = '+'; + + activeTags.splice(idx, 1); refreshTagsList(); } });