| Index: lib/subscriptionInit.js |
| =================================================================== |
| --- a/lib/subscriptionInit.js |
| +++ b/lib/subscriptionInit.js |
| @@ -31,19 +31,6 @@ |
| let firstRun; |
| let subscriptionsCallback = null; |
| -let filtersLoaded = new Promise(resolve => |
| -{ |
| - function onFilterAction(action) |
| - { |
| - if (action == "load") |
| - { |
| - FilterNotifier.removeListener(onFilterAction); |
| - resolve(); |
| - } |
| - } |
| - FilterNotifier.addListener(onFilterAction); |
| -}); |
| - |
| /** |
| * If there aren't any filters, the default subscriptions are added. |
| * However, if patterns.ini already did exist and/or any preference |
| @@ -172,9 +159,10 @@ |
| initNotifications(); |
| } |
| -Promise.all([filtersLoaded, Prefs.untilLoaded]).then(detectFirstRun) |
| - .then(getSubscriptions) |
| - .then(finishInitialization); |
| +Promise.all([FilterNotifier.once("load"), |
| + Prefs.untilLoaded]).then(detectFirstRun) |
| + .then(getSubscriptions) |
| + .then(finishInitialization); |
| /** |
| * Indicates whether the default filter subscriptions have been added |