summaryrefslogtreecommitdiff
path: root/js/Feeds.js
diff options
context:
space:
mode:
authorsupahgreg <supahgreg@users.noreply.github.com>2025-10-12 21:02:39 +0000
committersupahgreg <supahgreg@users.noreply.github.com>2025-10-12 21:34:29 +0000
commit39182a76e4070d3b92af10bf609fef8151bce6e4 (patch)
tree806c6e1b1ab421a2631f5e9062a8988480f8ba31 /js/Feeds.js
parent1299d632bdc8b676d3fc2114a1788a2f8f63597c (diff)
Address ESLint rule 'eqeqeq'.
https://eslint.org/docs/latest/rules/eqeqeq
Diffstat (limited to 'js/Feeds.js')
-rw-r--r--js/Feeds.js36
1 files changed, 19 insertions, 17 deletions
diff --git a/js/Feeds.js b/js/Feeds.js
index 71d9c29d4..825f6f8ef 100644
--- a/js/Feeds.js
+++ b/js/Feeds.js
@@ -31,7 +31,7 @@ const Feeds = {
entries.forEach((entry) => {
//console.log('feeds',entry.target, entry.intersectionRatio);
- if (entry.intersectionRatio == 0)
+ if (entry.intersectionRatio === 0)
Feeds.onHide(entry);
else
Feeds.onShow(entry);
@@ -50,7 +50,7 @@ const Feeds = {
// If number of properties is different,
// objects are not equivalent
- if (aProps.length != bProps.length) {
+ if (aProps.length !== bProps.length) {
return false;
}
@@ -87,13 +87,13 @@ const Feeds = {
const ts = elems[l].ts;
const updated = elems[l].updated;
- if (id == "global-unread") {
+ if (id === "global-unread") {
App.global_unread = ctr;
App.updateTitle();
continue;
}
- if (id == "subscribed-feeds") {
+ if (id === "subscribed-feeds") {
/* feeds_found = ctr; */
continue;
}
@@ -102,12 +102,14 @@ const Feeds = {
(kind == "cat")) {
}*/
- this.setUnread(id, (kind == "cat"), ctr);
- this.setValue(id, (kind == "cat"), 'auxcounter', parseInt(elems[l].auxcounter));
- this.setValue(id, (kind == "cat"), 'markedcounter', parseInt(elems[l].markedcounter));
- this.setValue(id, (kind == "cat"), 'publishedcounter', parseInt(elems[l].publishedcounter));
+ const is_cat = (kind === 'cat');
- if (kind != "cat") {
+ this.setUnread(id, is_cat, ctr);
+ this.setValue(id, is_cat, 'auxcounter', parseInt(elems[l].auxcounter));
+ this.setValue(id, is_cat, 'markedcounter', parseInt(elems[l].markedcounter));
+ this.setValue(id, is_cat, 'publishedcounter', parseInt(elems[l].publishedcounter));
+
+ if (!is_cat) {
this.setValue(id, false, 'error', error);
this.setValue(id, false, 'updated', updated);
@@ -130,7 +132,7 @@ const Feeds = {
PluginHost.run(PluginHost.HOOK_COUNTERS_PROCESSED, elems);
},
reloadCurrent: function(method) {
- if (this.getActive() != undefined) {
+ if (this.getActive() !== undefined) {
console.log("reloadCurrent", this.getActive(), this.activeIsCat(), method);
this.open({feed: this.getActive(), is_cat: this.activeIsCat(), method: method});
@@ -274,7 +276,7 @@ const Feeds = {
if (hash.query)
this._search_query = {query: hash.query, search_language: hash.search_language};
- if (hash.f != undefined) {
+ if (hash.f !== undefined) {
this.open({feed: parseInt(hash.f), is_cat: parseInt(hash.c)});
} else {
this.openDefaultFeed();
@@ -389,7 +391,7 @@ const Feeds = {
// this is used to quickly switch between feeds, sets active but xhr is on a timeout
const delayed = params.delayed || false;
- if (offset != 0) {
+ if (offset !== 0) {
if (this.infscroll_in_progress)
return;
@@ -419,9 +421,9 @@ const Feeds = {
query = Object.assign(query, this._search_query);
}
- if (offset != 0) {
+ if (offset !== 0) {
query.skip = offset;
- } else if (!is_cat && feed == this.getActive() && !params.method) {
+ } else if (!is_cat && feed === this.getActive() && !params.method) {
query.m = "ForceUpdate";
}
@@ -450,7 +452,7 @@ const Feeds = {
catchupAll: function() {
const str = __("Mark all articles as read?");
- if (App.getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
+ if (App.getInitParam("confirm_feed_catchup") !== 1 || confirm(str)) {
Notify.progress("Marking all feeds as read...");
@@ -509,7 +511,7 @@ const Feeds = {
if (next_feed !== false) {
this.open({feed: next_feed, is_cat: next_is_cat});
}
- } else if (feed == this.getActive() && is_cat == this.activeIsCat()) {
+ } else if (feed === this.getActive() && is_cat === this.activeIsCat()) {
this.reloadCurrent();
}
@@ -524,7 +526,7 @@ const Feeds = {
const str = __("Mark all articles in %s as read?").replace("%s", title);
- if (App.getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
+ if (App.getInitParam("confirm_feed_catchup") !== 1 || confirm(str)) {
const rows = App.findAll("#headlines-frame > div[id*=RROW][class*=Unread][data-orig-feed-id='" + id + "']");