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(`
[–] - ${comment.author} + ${comment.author}${isDeleted ? " (user deleted this comment)" : ""} ${prettyScore(comment.score)} point${(comment.score == 1) ? '': 's'} ${prettyDate(comment.created_utc) }
diff --git a/static/style.css b/static/style.css index d882ca5..811f613 100644 --- a/static/style.css +++ b/static/style.css @@ -92,6 +92,7 @@ a:hover { padding: 20px; border-radius: 5px; color: #fff; + word-wrap: break-word; } .error-box {