From 9c122022f11b52623c08418696884712f281c64f Mon Sep 17 00:00:00 2001 From: Domeniko Gentner Date: Fri, 4 Dec 2020 11:44:38 +0100 Subject: [PATCH] fixed regression when commenting without reply set --- js/labertasche.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/labertasche.js b/js/labertasche.js index f7cc592..50c2e6f 100644 --- a/js/labertasche.js +++ b/js/labertasche.js @@ -86,6 +86,12 @@ function labertasche_post_comment(btn, callback) return false; } + // When there is no reply, use null, otherwise an error occurs on chrome + let reply_value = null + if (reply != null){ + reply_value = reply.value; + } + callback('post-before-fetch'); fetch(remote, { @@ -100,7 +106,7 @@ function labertasche_post_comment(btn, callback) body: JSON.stringify({ "email": mail, "content": comment, "location": window.location.pathname, - "replied_to": reply.value + "replied_to": reply_value }) }) .then(async function(response){