X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=a042196c5fa42cc404aab419aab59aa4307ea1fb;hb=dd6d3a370a80ab515ec14636a3b2b4cbfa3f0ac1;hp=69c11e00b21912f76ab6c80b622fffc119bc7c3f;hpb=b360b7b166a51bf2161e5a051b0ae3d12c7bcba5;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 69c11e0..a042196 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -677,9 +677,12 @@ function loadNewPost(postId) { if (postId in loadedPosts) { return; } - loadedPosts[postId] = true; $.getJSON("getPost.ajax", { "post" : postId }, function(data, textStatus) { if ((data != null) && data.success) { + if (data.post.id in loadedPosts) { + return; + } + loadedPosts[data.post.id] = true; if (!isIndexPage() && !(isViewSonePage() && ((getShownSoneId() == data.post.sone) || (getShownSoneId() == data.post.recipient)))) { return; } @@ -707,10 +710,13 @@ function loadNewReply(replyId) { if (replyId in loadedReplies) { return; } - loadedReplies[replyId] = true; $.getJSON("getReply.ajax", { "reply": replyId }, function(data, textStatus) { /* find post. */ if ((data != null) && data.success) { + if (data.reply.id in loadedReplies) { + return; + } + loadedReplies[data.reply.id] = true; $("#sone .post#" + data.reply.postId).each(function() { var firstNewerReply = null; $(this).find(".replies .reply").each(function() {