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

Unified Diff: lib/prefs.js

Issue 5968535989780480: Issue 2567 - Simplified stats data structure, fixed regression resetting ad counter (Closed)
Patch Set: Created May 22, 2015, 1:07 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 | lib/stats.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/prefs.js
===================================================================
--- a/lib/prefs.js
+++ b/lib/prefs.js
@@ -104,12 +104,11 @@
*/
defaults.notificationurl = "https://notification.adblockplus.org/notification.json";
/**
- * The total number of ads blocked on all pages.
+ * The total number of requests blocked by the extension.
*
- * @type {object}
- * @property {number} [blocked]
+ * @type {number}
*/
-defaults.stats_total = {};
+defaults.blocked_total = 0;
/**
* Whether to show a badge in the toolbar icon indicating the number of blocked ads.
*
@@ -246,7 +245,7 @@
ext.storage.migratePrefs({
map: function(key, value)
{
- if (key in defaults)
+ if (key in defaults || key == "stats_total")
{
if (key != "currentVersion")
{
@@ -260,6 +259,12 @@
}
}
+ if (key == "stats_total")
+ {
+ key = "blocked_total";
+ value = value.blocked;
+ }
+
return {key: prefToKey(key), value: value};
}
« no previous file with comments | « no previous file | lib/stats.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld