Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/stats.js

Issue 29339020: Issue 3868 - Use the new FilterNotifier API (Closed)
Patch Set: Created March 23, 2016, 8:15 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/requestBlocker.js ('k') | lib/subscriptionInit.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/stats.js
===================================================================
--- a/lib/stats.js
+++ b/lib/stats.js
@@ -35,12 +35,9 @@
return blockedPerPage.get(page) || 0;
};
-FilterNotifier.addListener(function(action, item, newValue, oldValue, page)
+FilterNotifier.on("filter.hitCount", (filter, newValue, oldValue, page) =>
{
- if (action != "filter.hitCount" || !page)
- return;
-
- if (!(item instanceof BlockingFilter))
+ if (!(filter instanceof BlockingFilter) || !page)
return;
Prefs.blocked_total++;
@@ -58,7 +55,7 @@
}
});
-Prefs.on("show_statsinicon", function()
+Prefs.on("show_statsinicon", () =>
{
ext.pages.query({}, function(pages)
{
« no previous file with comments | « lib/requestBlocker.js ('k') | lib/subscriptionInit.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld