From: David ‘Bombe’ Roden Date: Thu, 2 Dec 2010 05:20:43 +0000 (+0100) Subject: Mark post as loaded when the AJAX reply has arrived. X-Git-Tag: 0.3.2-RC5~4 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=1a7c78f5bf78ad39d3b3c8c32a87749750cae14b Mark post as loaded when the AJAX reply has arrived. --- 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;