Index: lib/subscriptionInit.js |
=================================================================== |
--- a/lib/subscriptionInit.js |
+++ b/lib/subscriptionInit.js |
@@ -18,17 +18,17 @@ |
/** @module subscriptionInit */ |
"use strict"; |
const {Subscription, |
DownloadableSubscription, |
SpecialSubscription} = |
require("../adblockpluscore/lib/subscriptionClasses"); |
-const {FilterStorage} = require("../adblockpluscore/lib/filterStorage"); |
+const {filterStorage} = require("../adblockpluscore/lib/filterStorage"); |
const {filterNotifier} = require("../adblockpluscore/lib/filterNotifier"); |
const info = require("info"); |
const {Prefs} = require("./prefs"); |
const {Synchronizer} = require("../adblockpluscore/lib/synchronizer"); |
const {Utils} = require("./utils"); |
const {initNotifications} = require("./notificationHelper"); |
const {updatesVersion} = require("../adblockplusui/lib/prefs"); |
@@ -44,19 +44,19 @@ |
* first run, but something went wrong. |
* |
* This function detects the first run, and makes sure that the user |
* gets notified (on the first run page) if the data appears incomplete |
* and therefore will be reinitialized. |
*/ |
function detectFirstRun() |
{ |
- firstRun = FilterStorage.subscriptions.length == 0; |
+ firstRun = filterStorage.subscriptionCount == 0; |
- if (firstRun && (!FilterStorage.firstRun || Prefs.currentVersion)) |
+ if (firstRun && (!filterStorage.firstRun || Prefs.currentVersion)) |
reinitialized = true; |
Prefs.currentVersion = info.addonVersion; |
} |
/** |
* Determines whether to add the default ad blocking subscriptions. |
* Returns true, if there are no filter subscriptions besides those |
@@ -66,26 +66,26 @@ |
* is no data and therefore no subscriptions. But it also causes the |
* default ad blocking subscriptions to be added again after some |
* data corruption or misconfiguration. |
* |
* @return {boolean} |
*/ |
function shouldAddDefaultSubscriptions() |
{ |
- for (let subscription of FilterStorage.subscriptions) |
+ for (let subscription of filterStorage.subscriptions()) |
{ |
if (subscription instanceof DownloadableSubscription && |
subscription.url != Prefs.subscriptions_exceptionsurl && |
subscription.url != Prefs.subscriptions_antiadblockurl && |
subscription.type != "circumvention") |
return false; |
if (subscription instanceof SpecialSubscription && |
- subscription.filters.length > 0) |
+ subscription.filterCount > 0) |
Jon Sonesen
2018/12/06 23:09:04
Done.
|
return false; |
} |
return true; |
} |
/** |
* @typedef {object} DefaultSubscriptions |
@@ -261,17 +261,17 @@ |
function addSubscriptionsAndNotifyUser(subscriptions) |
{ |
if (subscriptionsCallback) |
subscriptions = subscriptionsCallback(subscriptions); |
for (let subscription of subscriptions) |
{ |
- FilterStorage.addSubscription(subscription); |
+ filterStorage.addSubscription(subscription); |
if (subscription instanceof DownloadableSubscription && |
!subscription.lastDownload) |
Synchronizer.execute(subscription); |
} |
// Show first run page or the updates page. The latter is only shown |
// on Chromium (since the current updates page announces features that |
// aren't new to Firefox users), and only if this version of the |