X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=7d7bcb557b0c07dd49a965a59f17f5933ea851fa;hp=a4ad957acf2e18b86ed0aa333112079a66426fdb;hb=2dab45dd964a48144d8c919b491f792b53f5a2ea;hpb=8d8cc8a9cced7cc9171cc09ce0fd024145605d70 diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index a4ad957..7d7bcb5 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -611,6 +611,10 @@ function loadNewPost(postId) { loadedPosts[postId] = true; $.getJSON("ajax/getPost.ajax", { "post" : postId }, function(data, textStatus) { if ((data != null) && data.success) { + /* maybe weird timing stuff ensues. */ + if (data.post.id in loadedPosts) { + return; + } var firstOlderPost = null; $("#sone .post").each(function() { if (getPostTime(this) < data.post.time) { @@ -638,6 +642,10 @@ function loadNewReply(replyId) { $.getJSON("ajax/getReply.ajax", { "reply": replyId }, function(data, textStatus) { /* find post. */ if ((data != null) && data.success) { + /* maybe weird timing stuff ensues. */ + if (data.reply.id in loadedReplies) { + return; + } $("#sone .post#" + data.reply.postId).each(function() { var firstNewerReply = null; $(this).find(".replies .reply").each(function() {