From 7554e62e2d7a4b21f500c63f1c071d44daa6803a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 1 Dec 2010 17:23:58 +0100 Subject: [PATCH] Try to prevent multiple insertion of the same replies. --- src/main/resources/static/javascript/sone.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() { -- 2.7.4