Index: js/desktop-options.js |
=================================================================== |
--- a/js/desktop-options.js |
+++ b/js/desktop-options.js |
@@ -468,7 +468,6 @@ |
updateFilter(filter); |
setCustomFiltersView("read"); |
- isCustomFiltersLoaded = true; |
} |
function removeCustomFilter(text) |
@@ -1147,18 +1146,12 @@ |
}, |
(subscriptions) => |
{ |
- // Load filters |
- for (let subscription of subscriptions) |
+ let customFilterPromises = subscriptions.map(getSubscriptionFilters); |
+ Promise.all(customFilterPromises).then((filters) => |
{ |
- browser.runtime.sendMessage({ |
- type: "filters.get", |
- subscriptionUrl: subscription.url |
- }, |
- (filters) => |
- { |
- loadCustomFilters(filters); |
- }); |
- } |
+ loadCustomFilters([].concat(...filters)); |
+ isCustomFiltersLoaded = true; |
+ }); |
}); |
loadRecommendations(); |
browser.runtime.sendMessage({ |
@@ -1335,6 +1328,13 @@ |
} |
} |
+function getSubscriptionFilters(subscription) |
+{ |
+ return browser.runtime.sendMessage({ |
+ type: "filters.get", |
+ subscriptionUrl: subscription.url}); |
+} |
+ |
function hidePref(key, value) |
{ |
let element = document.querySelector("[data-pref='" + key + "']"); |