Fix bug where strings would be appended on click despite trying to cancel it

This commit is contained in:
Kiril Kovachev 2024-10-15 19:19:24 +01:00
parent 35e3378db6
commit 9b932291d2

View File

@ -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")) {