diff --git a/static/script.js b/static/script.js index 66f10de..0b2f989 100644 --- a/static/script.js +++ b/static/script.js @@ -25,6 +25,7 @@ const continuethisthreadIDs = [] const maxIDsPerRequest = 100 const commentLookup = new Map() const commentsToCreate = [] +const deletedCommentIDs = [] let totalComments @@ -144,8 +145,11 @@ async function getRemovedComments(allCommentIDs) { commentIDs.forEach(id => { if(commentLookup.has(id)) { - if(commentLookup.get(id).body === "[removed]" || commentLookup.get(id).body === "[deleted]") { + if(commentLookup.get(id).body === "[removed]") { idsDiff.push(id) + } else if (commentLookup.get(id).body === "[deleted]"){ + idsDiff.push(id) + deletedCommentIDs.push(id) } } }) @@ -288,13 +292,14 @@ function generateThread(data) { mainDiv.appendChild(threadDiv) } function createComment(comment) { + const isDeleted = deletedCommentIDs.includes(comment.id) const isRemoved = comment.hasOwnProperty("removed") return generateHTML(`