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

Unified Diff: lib/stats.js

Issue 12326007: Fixed: Total blocked count was not saved across multiple sessions (Closed)
Patch Set: Created Oct. 2, 2013, 8:20 a.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
@@ -45,15 +45,15 @@
if (action != "filter.hitCount")
return;
- var blocked = item instanceof BlockingFilter;
+ let statsTotal = Prefs.stats_total;
// Increment counts
- if (blocked)
+ if (item instanceof BlockingFilter)
{
- if ("blocked" in Prefs.stats_total)
- Prefs.stats_total.blocked++;
+ if ("blocked" in statsTotal)
+ statsTotal.blocked++;
else
- Prefs.stats_total.blocked = 1;
+ statsTotal.blocked = 1;
Wladimir Palant 2013/10/02 09:26:26 Adding Prefs.stats_total = Prefs.stats_total; here
let frameData = getFrameData(tabId, 0);
if (frameData)
@@ -64,4 +64,6 @@
frameData.blocked = 1;
}
}
+
+ Prefs.stats_total = statsTotal;
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld