Only insert posts when on the index or an appropriate “view Sone” page.
[Sone.git] / src / main / resources / static / javascript / sone.js
index cb16e64..f3ea9e8 100644 (file)
@@ -650,6 +650,9 @@ function loadNewPost(postId) {
        loadedPosts[postId] = true;
        $.getJSON("ajax/getPost.ajax", { "post" : postId }, function(data, textStatus) {
                if ((data != null) && data.success) {
+                       if (!isIndexPage() && !(isViewSonePage() && (getSoneId() == data.post.sone))) {
+                               return;
+                       }
                        var firstOlderPost = null;
                        $("#sone .post").each(function() {
                                if (getPostTime(this) < data.post.time) {