]> git.wh0rd.org Git - tt-rss.git/commitdiff
dispose from out of sequence article_callback2() calls
authorAndrew Dolgov <fox@bah.spb.su>
Tue, 20 May 2008 16:06:12 +0000 (17:06 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Tue, 20 May 2008 16:06:12 +0000 (17:06 +0100)
viewfeed.js

index bd548ced9b0b77c8496d421a66a7b9414b0b5b89..713cc7e440f69ddf1dca2f577cd8c4a33e2e37a1 100644 (file)
@@ -20,6 +20,8 @@ var article_cache = new Array();
 var vgroup_last_feed = false;
 var post_under_pointer = false;
 
+var last_requested_article = false;
+
 function catchup_callback() {
        if (xmlhttp_rpc.readyState == 4) {
                try {
@@ -320,6 +322,8 @@ function article_callback2(transport, id, feed_id) {
        try {
                debug("article_callback2 " + id);
 
+               if (id != last_requested_article) return;
+
                if (transport.responseXML) {
 
                        active_real_feed_id = feed_id;
@@ -435,6 +439,7 @@ function view(id, feed_id, skip_history) {
 
                        query = query + "&mode=prefetch";
 
+                       showArticleInHeadlines(id);
                        render_article(cached_article);
 
                } else if (cached_article) {
@@ -447,6 +452,8 @@ function view(id, feed_id, skip_history) {
 
                cache_expire();
 
+               last_requested_article = id;
+
                new Ajax.Request(query, {
                        onComplete: function(transport) { 
                                article_callback2(transport, id, feed_id);