Mark post as loaded when the AJAX reply has arrived.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 2 Dec 2010 05:20:43 +0000 (06:20 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 2 Dec 2010 19:34:02 +0000 (20:34 +0100)
src/main/resources/static/javascript/sone.js

index 0d1772e..b44f19e 100644 (file)
@@ -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;