From dd6d3a370a80ab515ec14636a3b2b4cbfa3f0ac1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 5 Dec 2010 17:39:00 +0100 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20use=20the=20ID=20from=20the=20cl?= =?utf8?q?osure,=20it=20might=20have=20changed=20its=20value.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Oh, the joys of Javascript. :) --- src/main/resources/static/javascript/sone.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index b44f19e..a042196 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -678,11 +678,11 @@ function loadNewPost(postId) { return; } $.getJSON("getPost.ajax", { "post" : postId }, function(data, textStatus) { - if (postId in loadedPosts) { - return; - } - loadedPosts[postId] = true; 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; } @@ -711,12 +711,12 @@ function loadNewReply(replyId) { return; } $.getJSON("getReply.ajax", { "reply": replyId }, function(data, textStatus) { - if (replyId in loadedReplies) { - return; - } - loadedReplies[replyId] = true; /* 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() { -- 2.7.4