Try to prevent multiple insertion of the same replies.
[Sone.git] / src / main / resources / static / javascript / sone.js
index 69c11e0..0d1772e 100644 (file)
@@ -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() {