From 1a7c78f5bf78ad39d3b3c8c32a87749750cae14b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 2 Dec 2010 06:20:43 +0100 Subject: [PATCH] Mark post as loaded when the AJAX reply has arrived. --- 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 0d1772e..b44f19e 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -677,8 +677,11 @@ function loadNewPost(postId) { if (postId in loadedPosts) { return; } - loadedPosts[postId] = true; $.getJSON("getPost.ajax", { "post" : postId }, function(data, textStatus) { + if (postId in loadedPosts) { + return; + } + loadedPosts[postId] = true; if ((data != null) && data.success) { if (!isIndexPage() && !(isViewSonePage() && ((getShownSoneId() == data.post.sone) || (getShownSoneId() == data.post.recipient)))) { return; -- 2.7.4