From 18612933f6c3598238de308998fb7b12cce681bd Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Sun, 28 Feb 2021 12:44:10 +0530 Subject: [PATCH] commento.js: show error when comment link is 404 Signed-off-by: Adhityaa Chandrasekar --- api/comment_delete_test.go | 2 +- frontend/js/commento.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api/comment_delete_test.go b/api/comment_delete_test.go index cbaa1ab..f758e2f 100644 --- a/api/comment_delete_test.go +++ b/api/comment_delete_test.go @@ -8,7 +8,7 @@ import ( func TestCommentDeleteBasics(t *testing.T) { failTestOnError(t, setupTestEnv()) - commenterHex = "temp-commenter-hex" + commenterHex := "temp-commenter-hex" commentHex, _ := commentNew(commenterHex, "example.com", "/path.html", "root", "**foo**", "approved", time.Now().UTC()) commentNew(commenterHex, "example.com", "/path.html", commentHex, "**bar**", "approved", time.Now().UTC()) diff --git a/frontend/js/commento.js b/frontend/js/commento.js index 9cf67db..a6e40b8 100644 --- a/frontend/js/commento.js +++ b/frontend/js/commento.js @@ -2107,6 +2107,7 @@ if (window.location.hash.startsWith("#commento-")) { var el = $(ID_CARD + window.location.hash.split("-")[1]); if (el === null) { + errorShow("The comment you're looking for no longer exists. Perhaps it was deleted by the commenter or a moderator?"); return; }