diff options
author | Andrew Dolgov <[email protected]> | 2006-08-12 15:36:39 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2006-08-12 15:36:39 +0100 |
commit | 9e397d0f5a9d2e8e39f27cf714efd4c4cc8cec87 (patch) | |
tree | fdde9b27c1165bc61647393deff6aeaf598ae7f8 /functions.js | |
parent | f26baf361dbaa743f7be5e058a325dd7d9b52b1e (diff) |
refresh feeds frame if number of subscriptions failed
Diffstat (limited to 'functions.js')
-rw-r--r-- | functions.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/functions.js b/functions.js index cef4692c6..495bcd646 100644 --- a/functions.js +++ b/functions.js @@ -481,6 +481,8 @@ function parse_counters(reply, scheduled_call) { var f_document = getFeedsContext().document; var title_obj = getMainContext(); + var feeds_found = 0; + if (reply.firstChild && reply.firstChild.firstChild) { debug("<b>wrong element passed to parse_counters, adjusting.</b>"); reply = reply.firstChild; @@ -502,6 +504,10 @@ function parse_counters(reply, scheduled_call) { var has_img = reply.childNodes[l].getAttribute("hi"); var updated = reply.childNodes[l].getAttribute("updated"); + if (t == "feed") { + feeds_found++; + } + if (id == "global-unread") { title_obj.global_unread = ctr; title_obj.updateTitle(); @@ -575,6 +581,21 @@ function parse_counters(reply, scheduled_call) { } } } + + var feeds_stored = getMainContext().number_of_feeds; + + debug("Feed counters, C: " + feeds_found + ", S:" + feeds_stored); + + if (feeds_stored != feeds_found) { + if (feeds_found != 0) { + getMainContext().number_of_feeds = feeds_found; + } + if (feeds_stored != 0 && feeds_found != 0) { + debug("Subscribed feed number changed, refreshing feedlist"); + updateFeedList(); + } + } + } catch (e) { exception_error("parse_counters", e); } |