| Index: lib/subscriptionInit.js |
| =================================================================== |
| --- a/lib/subscriptionInit.js |
| +++ b/lib/subscriptionInit.js |
| @@ -44,17 +44,17 @@ |
| * 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.knownSubscriptions.size == 0; |
|
Manish Jethani
2018/10/15 23:54:47
The intention was to expose the subscriptions gene
Jon Sonesen
2018/11/29 17:33:54
Acknowledged.
|
| if (firstRun && (!FilterStorage.firstRun || Prefs.currentVersion)) |
| reinitialized = true; |
| Prefs.currentVersion = info.addonVersion; |
| } |
| /** |
| @@ -66,17 +66,17 @@ |
| * 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.knownSubscriptions.values()]) |
|
Manish Jethani
2018/10/15 23:54:47
Similarly, let's make this `FilterStorage.subscrip
Jon Sonesen
2018/11/29 17:33:54
Acknowledged.
|
| { |
| if (subscription instanceof DownloadableSubscription && |
| subscription.url != Prefs.subscriptions_exceptionsurl && |
| subscription.url != Prefs.subscriptions_antiadblockurl && |
| subscription.type != "circumvention") |
| return false; |
| if (subscription instanceof SpecialSubscription && |
| @@ -99,17 +99,17 @@ |
| * @param {HTMLCollection} subscriptions |
| * @return {DefaultSubscriptions} |
| */ |
| function chooseFilterSubscriptions(subscriptions) |
| { |
| let selectedItem = {}; |
| let selectedPrefix = null; |
| let matchCount = 0; |
| - for (let subscription of subscriptions) |
| + for (let subscription of [...subscriptions]) |
|
Manish Jethani
2018/10/15 23:54:47
Not required.
Jon Sonesen
2018/11/29 17:33:54
Acknowledged.
|
| { |
| let prefixes = subscription.getAttribute("prefixes"); |
| let prefix = prefixes && prefixes.split(",").find( |
| lang => new RegExp("^" + lang + "\\b").test(Utils.appLocale) |
| ); |
| let subscriptionType = subscription.getAttribute("type"); |
| @@ -259,17 +259,17 @@ |
| return subscriptions; |
| } |
| function addSubscriptionsAndNotifyUser(subscriptions) |
| { |
| if (subscriptionsCallback) |
| subscriptions = subscriptionsCallback(subscriptions); |
| - for (let subscription of subscriptions) |
| + for (let subscription of [...subscriptions]) |
|
Manish Jethani
2018/10/15 23:54:47
Not required.
Jon Sonesen
2018/11/29 17:33:54
Acknowledged.
|
| { |
| 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 |