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

Unified Diff: background.js

Issue 6468765319430144: Issue 417 - Reinitializing removed filter lists (Platform) (Closed)
Patch Set: Fixed: Message also appeared on first-run Created May 27, 2014, 12: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/filesystem/io.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: background.js
===================================================================
--- a/background.js
+++ b/background.js
@@ -54,6 +54,7 @@
&& (navigator.platform.indexOf("Linux") == -1 || parseInt(require("info").applicationVersion) > 34);
var seenDataCorruption = false;
+var filterlistsReinitialized = false;
require("filterNotifier").FilterNotifier.addListener(function(action)
{
if (action == "load")
@@ -62,6 +63,14 @@
var addonVersion = require("info").addonVersion;
var prevVersion = ext.storage.currentVersion;
+
+ // There are no filters stored so we need to reinitialize all filterlists
+ if (!FilterStorage.firstRun && FilterStorage.subscriptions.length === 0)
+ {
+ filterlistsReinitialized = true;
+ prevVersion = null;
+ }
+
if (prevVersion != addonVersion || FilterStorage.firstRun)
{
seenDataCorruption = prevVersion && FilterStorage.firstRun;
« no previous file with comments | « no previous file | lib/filesystem/io.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld