From 9783a4470109f760578a99bdb28552706bd0fa5d Mon Sep 17 00:00:00 2001 From: Jesper Wrang Date: Mon, 11 Sep 2017 07:56:28 +0200 Subject: [PATCH] Small bug fix --- static/script.js | 8 +++++--- templates/frontpage.html | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/static/script.js b/static/script.js index 67456d8..66f10de 100644 --- a/static/script.js +++ b/static/script.js @@ -140,16 +140,18 @@ function extractMorechildrenIDs(comments) { async function getRemovedComments(allCommentIDs) { - const idsDiff = allCommentIDs.filter(x => !commentIDs.includes(x)) + let idsDiff = allCommentIDs.filter(x => !commentIDs.includes(x)) commentIDs.forEach(id => { if(commentLookup.has(id)) { - if(commentLookup.get(id).body === "[removed]") { + if(commentLookup.get(id).body === "[removed]" || commentLookup.get(id).body === "[deleted]") { idsDiff.push(id) } } }) + idsDiff = [...new Set(idsDiff)] + generateCommentInfo(idsDiff.length) console.log("All ids :", allCommentIDs) console.log("Comments ids (dup): ", commentIDs) @@ -279,7 +281,7 @@ function generateThread(data) { ${thread.selftext !== '' ? '
'+markdown.render(thread.selftext)+'
':''}
${totalComments} comments
${thread.media !== null ? parseHTML(thread.media_embed.content) : ''} - ${imageHosts.includes(thread.domain) ? '' : ''} + ${imageHosts.includes(thread.domain) && thread.hasOwnProperty("preview") ? '' : ''} ` diff --git a/templates/frontpage.html b/templates/frontpage.html index 8407313..85f1445 100644 --- a/templates/frontpage.html +++ b/templates/frontpage.html @@ -6,8 +6,8 @@

How to use: go to any Reddit thread and replace the reddit in the URL with removeddit
E.g. - - https://www.removeddit.com/r/TwoXChromosomes/comments/6z1hch/malala_says_oxford_was_the_hardest_interview_of/ + + https://www.removeddit.com/r/TwoXChromosomes/comments/6z1hch/