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

Delta Between Two Patch Sets: background.js

Issue 6468765319430144: Issue 417 - Reinitializing removed filter lists (Platform) (Closed)
Left Patch Set: Created May 26, 2014, 9:44 a.m.
Right Patch Set: Fixed: Message also appeared on first-run Created May 27, 2014, 12:07 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | lib/filesystem/io.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 var seenDataCorruption = false; 56 var seenDataCorruption = false;
57 var filterlistsReinitialized = false; 57 var filterlistsReinitialized = false;
58 require("filterNotifier").FilterNotifier.addListener(function(action) 58 require("filterNotifier").FilterNotifier.addListener(function(action)
59 { 59 {
60 if (action == "load") 60 if (action == "load")
61 { 61 {
62 var importingOldData = importOldData(); 62 var importingOldData = importOldData();
63 63
64 var addonVersion = require("info").addonVersion; 64 var addonVersion = require("info").addonVersion;
65 var prevVersion = ext.storage.currentVersion; 65 var prevVersion = ext.storage.currentVersion;
66
67 // There are no filters stored so we need to reinitialize all filterlists
68 if (!FilterStorage.firstRun && FilterStorage.subscriptions.length === 0)
69 {
70 filterlistsReinitialized = true;
71 prevVersion = null;
72 }
73
66 if (prevVersion != addonVersion || FilterStorage.firstRun) 74 if (prevVersion != addonVersion || FilterStorage.firstRun)
67 { 75 {
68 seenDataCorruption = prevVersion && FilterStorage.firstRun; 76 seenDataCorruption = prevVersion && FilterStorage.firstRun;
69 ext.storage.currentVersion = addonVersion; 77 ext.storage.currentVersion = addonVersion;
70 if (!importingOldData) 78 if (!importingOldData)
71 addSubscription(prevVersion); 79 addSubscription(prevVersion);
72 } 80 }
73 81
74 if (canUseChromeNotifications) 82 if (canUseChromeNotifications)
75 initChromeNotifications(); 83 initChromeNotifications();
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 page.sendMessage({type: "clickhide-deactivate"}); 607 page.sendMessage({type: "clickhide-deactivate"});
600 refreshIconAndContextMenu(page); 608 refreshIconAndContextMenu(page);
601 }); 609 });
602 610
603 setTimeout(function() 611 setTimeout(function()
604 { 612 {
605 var notificationToShow = Notification.getNextToShow(); 613 var notificationToShow = Notification.getNextToShow();
606 if (notificationToShow) 614 if (notificationToShow)
607 showNotification(notificationToShow); 615 showNotification(notificationToShow);
608 }, 3 * 60 * 1000); 616 }, 3 * 60 * 1000);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld