From 410e1513ac4904a5a0c484bffe06df98b2f62c28 Mon Sep 17 00:00:00 2001 From: Ryan Stafford Date: Sun, 28 Apr 2024 12:12:04 -0400 Subject: [PATCH] fix read post --- public/utils.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/utils.js b/public/utils.js index 530922a..b1c0eb9 100644 --- a/public/utils.js +++ b/public/utils.js @@ -5,7 +5,7 @@ function request(url, params, callback, errorcallback = function(){}) { if (xmlHttp.status == 200) { return callback(xmlHttp.responseText); } - if (errorcallback) errorcallback(xmlHttp.responseText); + errorcallback(xmlHttp.responseText); } var method = "GET" if (params) method = "POST" @@ -33,7 +33,12 @@ function postClick(e) { var url = targ.getElementsByClassName("url")[0].href if (bdy.querySelector("img.image") && localStorage.getItem("markRead") == "true") { bdy.parentNode.querySelector(".title").className = "title visited" - request(bdy.parentNode.querySelector('.buttons a').href, { op: "read_post", submit: "mark read"}) + var data = new FormData(); + data.append("op", "read_post") + data.append("submit", "mark read") + data.append("xhr", "1") + data.append("postid", bdy.parentNode.parentNode.id.slice(1)) + request("", data) } if (id = parseYoutube(url)) { targ.getElementsByClassName("embed")[0].innerHTML = youtubeIframe(id)