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

Unified Diff: js/desktop-options.js

Issue 29712599: Issue 6420 - Fixed poping up whitelisted website notification for several custom filter lists (Closed)
Patch Set: Created March 5, 2018, 8:26 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ext/content.js ('K') | « ext/content.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 + "']");
« ext/content.js ('K') | « ext/content.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld