From: David ‘Bombe’ Roden Date: Wed, 1 Dec 2010 16:23:58 +0000 (+0100) Subject: Try to prevent multiple insertion of the same replies. X-Git-Tag: 0.3.2-RC5~5 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7554e62e2d7a4b21f500c63f1c071d44daa6803a;p=Sone.git Try to prevent multiple insertion of the same replies. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 69c11e0..0d1772e 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -707,8 +707,11 @@ function loadNewReply(replyId) { if (replyId in loadedReplies) { return; } - loadedReplies[replyId] = true; $.getJSON("getReply.ajax", { "reply": replyId }, function(data, textStatus) { + if (replyId in loadedReplies) { + return; + } + loadedReplies[replyId] = true; /* find post. */ if ((data != null) && data.success) { $("#sone .post#" + data.reply.postId).each(function() {