hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
- var feeds_stored = number_of_feeds;
-
- if (feeds_stored != feeds_found) {
- number_of_feeds = feeds_found;
-
- if (feeds_stored != 0 && feeds_found != 0) {
- console.log("Subscribed feed number changed, refreshing feedlist");
- setTimeout('updateFeedList()', 50);
- }
- }
-
} catch (e) {
exception_error("parse_counters", e);
}
if (inPreferences()) {
updateFeedList();
} else {
- dlg_frefresh_callback(transport, feed_id);
+ if (feed_id == getActiveFeedId())
+ setTimeout("viewfeed(-5)", 100);
}
} });
parameters: dojo.objectToQuery(dialog.attr('value')),
onComplete: function(transport) {
dialog.hide();
- if (inPreferences()) {
- updateFeedList();
- } else {
- notify('');
- dlg_frefresh_callback(transport);
- }
+ updateFeedList();
}})
}
},
if (inPreferences()) {
updateFeedList();
- } else {
- setTimeout('updateFeedList(false, false)', 50);
}
} });
$params["bw_limit"] = (int) $_SESSION["bw_limit"];
$params["offline_enabled"] = (int) get_pref($link, "ENABLE_OFFLINE_READING");
- $result = db_query($link, "SELECT COUNT(*) AS cf FROM
+ $result = db_query($link, "SELECT MAX(id) AS mid, COUNT(*) AS nf FROM
ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);
- $num_feeds = db_fetch_result($result, 0, "cf");
+ $max_feed_id = db_fetch_result($result, 0, "mid");
+ $num_feeds = db_fetch_result($result, 0, "nf");
+ $params["max_feed_id"] = (int) $max_feed_id;
$params["num_feeds"] = (int) $num_feeds;
+
$params["collapsed_feedlist"] = (int) get_pref($link, "_COLLAPSED_FEEDLIST");
return $params;
}
function make_runtime_info($link) {
- $result = db_query($link, "SELECT COUNT(*) AS cf FROM
+ $data = array();
+
+ $result = db_query($link, "SELECT MAX(id) AS mid, COUNT(*) AS nf FROM
ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);
- $num_feeds = db_fetch_result($result, 0, "cf");
+ $max_feed_id = db_fetch_result($result, 0, "mid");
+ $num_feeds = db_fetch_result($result, 0, "nf");
- $data = array();
+ $data["max_feed_id"] = (int) $max_feed_id;
+ $data["num_feeds"] = (int) $num_feeds;
- $data['num_feeds'] = (int) $num_feeds;
$data['last_article_id'] = getLastArticleId($link);
$data['cdm_expanded'] = get_pref($link, 'CDM_EXPANDED');
var firsttime_update = true;
var _active_feed_id = 0;
var _active_feed_is_cat = false;
-var number_of_feeds = 0;
var hotkey_prefix = false;
var hotkey_prefix_pressed = false;
var init_params = {};
}
-function dlg_frefresh_callback(transport, deleted_feed) {
- if (getActiveFeedId() == deleted_feed) {
- setTimeout("viewfeed(-5)", 100);
- }
-
- setTimeout('updateFeedList()', 50);
- closeInfoBox();
-}
-
function updateFeedList() {
try {
return;
}
+ if (k == "max_feed_id" || k == "num_feeds") {
+ if (init_params[k] != v) {
+ console.log("feed count changed, need to reload feedlist.");
+ updateFeedList();
+ }
+ }
+
init_params[k] = v;
notify('');
}