+function viewfeed(params) {
+ const feed = params.feed;
+ let is_cat = params.is_cat;
+ let offset = params.offset;
+ let background = params.background;
+ let infscroll_req = params.infscroll_req;
+ const can_wait = params.can_wait;
+ const viewfeed_debug = params.viewfeed_debug;
+ const method = params.method;
+
+ if (is_cat == undefined)
+ is_cat = false;
+ else
+ is_cat = !!is_cat;
+
+ if (offset == undefined) offset = 0;
+ if (background == undefined) background = false;
+ if (infscroll_req == undefined) infscroll_req = false;
+
+ last_requested_article = 0;
+
+ if (feed != getActiveFeedId() || activeFeedIsCat() != is_cat) {
+ if (!background && _search_query) _search_query = false;
+ }
+
+ if (!background) {
+ _viewfeed_last = get_timestamp();
+
+ if (getActiveFeedId() != feed || !infscroll_req) {
+ setActiveArticleId(0);
+ _infscroll_disable = 0;