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

Unified Diff: lib/stats.js

Issue 5855687158530048: Issue 348 - Fixed bug when updating badge in response to preference change (Closed)
Patch Set: Created April 18, 2014, 8:21 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 | « no previous file | no next file » | 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
@@ -84,20 +84,26 @@
if (name != "show_statsinicon")
return;
- ext.pages.query({}, function(page)
+ ext.pages.query({}, function(pages)
{
- let badge = null;
- if (Prefs.show_statsinicon)
+ for (var i = 0; i < pages.length; i++)
{
- let pageStats = statsPerPage.get(page);
- if (pageStats && "blocked" in pageStats)
+ let page = pages[i];
+ let badge = null;
+
+ if (Prefs.show_statsinicon)
{
- badge = {
- color: badgeColor,
- number: pageStats.blocked
- };
+ let pageStats = statsPerPage.get(page);
+ if (pageStats && "blocked" in pageStats)
+ {
+ badge = {
+ color: badgeColor,
+ number: pageStats.blocked
+ };
+ }
}
+
+ page.browserAction.setBadge(badge);
}
- page.browserAction.setBadge(badge);
});
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld