From 9b932291d2f4458688c5fb05fec5c15877ecd108 Mon Sep 17 00:00:00 2001 From: Kiril Kovachev Date: Tue, 15 Oct 2024 19:19:24 +0100 Subject: [PATCH] Fix bug where strings would be appended on click despite trying to cancel it --- kanken_online/static/translations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kanken_online/static/translations.js b/kanken_online/static/translations.js index 7a470d8..6cc6963 100644 --- a/kanken_online/static/translations.js +++ b/kanken_online/static/translations.js @@ -1,7 +1,7 @@ const addStringButton = document.getElementById("add-string-button"); addStringButton.addEventListener("click", (e) => { const stringName = prompt("Enter a string name: "); - if (stringName == "") { + if (!stringName) { return; } for (let section of document.getElementsByClassName("translation-section")) {