diff --git a/main b/main index fca487b..f1eb8f9 100644 --- a/main +++ b/main @@ -382,7 +382,7 @@ def signup(): if usersession: return redirect(url_for("main")) if request.method == "POST": - if not check_username_taken(request.form["username"]) == "error": + if not check_username_taken(str(request.form["username"]).lower()) == "error": flash("Username already taken :3") return redirect(url_for("signup")) diff --git a/static/js/main.js b/static/js/main.js index c7a09c7..62e9a3e 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -22,15 +22,13 @@ for (let i = 0; i < posts.length; i++) { title = String(commentBox.value) id = String(commentId.innerHTML) + commentDiv.classList.add("hidden") + commentBurgerDiv.classList.remove("hidden") - function addPost() { - console.log("fart") - - let para = document.createElement("p"); - const node = document.createTextNode(usernameElement.innerHTML + ": " + title); - para.appendChild(node) - commentBurgerDiv.append(para) - } + let para = document.createElement("p"); + const node = document.createTextNode(usernameElement.innerHTML + ": " + title); + para.appendChild(node) + commentBurgerDiv.append(para) fetch("/api/comment", { method: "POST", @@ -42,8 +40,5 @@ for (let i = 0; i < posts.length; i++) { "Content-Type": "application/json" } }) - .then((response) => addPost()) - - commentDiv.classList.add("hidden") }); } \ No newline at end of file diff --git a/templates/main.html b/templates/main.html index 1d854b5..8bf9951 100644 --- a/templates/main.html +++ b/templates/main.html @@ -51,7 +51,7 @@ {% endfor %} {% else %} - + {% endif %}