From 3f7b65dee97851330050a1b9c0a75302f94c4fc1 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Tue, 12 Feb 2019 22:15:06 -0500 Subject: [PATCH] commento.js: fix anonymous selfHex logic in commentNew --- frontend/js/commento.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/js/commento.js b/frontend/js/commento.js index 08da00a..9927dea 100644 --- a/frontend/js/commento.js +++ b/frontend/js/commento.js @@ -540,17 +540,18 @@ } if (message !== "") { - if (id === "root") { - prepend($(ID_SUPER_CONTAINER + id), messageCreate(message)); - } else { - append($(ID_BODY + id), messageCreate(message)); - } + prepend($(ID_SUPER_CONTAINER + id), messageCreate(message)); } + var commenterHex = selfHex; + if (commenterHex === undefined && commenterTokenGet() === "anonymous") { + commenterHex = "anonymous"; + } + var newCard = commentsRecurse({ "root": [{ "commentHex": resp.commentHex, - "commenterHex": selfHex, + "commenterHex": commenterHex, "markdown": markdown, "html": resp.html, "parentHex": "root",