Index: new-options.js |
=================================================================== |
--- a/new-options.js |
+++ b/new-options.js |
@@ -449,6 +449,15 @@ |
filtersMap[filter.text] = filter; |
} |
+ function loadCustomFilters(filters) |
+ { |
+ for (let filter of filters) |
+ updateFilter(filter); |
+ |
+ setCustomFiltersView("read"); |
+ isCustomFiltersLoaded = true; |
+ } |
+ |
function removeCustomFilter(text) |
{ |
let index = customFilters.indexOf(text); |
@@ -1055,6 +1064,7 @@ |
for (let property in collections) |
collections[property].clearAll(); |
+ setCustomFiltersView("empty"); |
ext.backgroundPage.sendMessage({ |
type: "subscriptions.get", |
special: true |
@@ -1070,11 +1080,7 @@ |
}, |
(filters) => |
{ |
- for (let filter of filters) |
- updateFilter(filter); |
- |
- isCustomFiltersLoaded = true; |
- setCustomFiltersView("read"); |
+ loadCustomFilters(filters); |
}); |
} |
}); |
@@ -1210,7 +1216,13 @@ |
break; |
case "added": |
let {url, recommended} = subscription; |
- if (url in subscriptionsMap) |
+ // Handle custom subscription |
+ if (/^~user/.test(url)) |
saroyanm
2017/09/27 20:05:41
I don't think there is an easy way to check if thi
|
+ { |
+ loadCustomFilters(subscription.filters); |
+ return; |
+ } |
+ else if (url in subscriptionsMap) |
updateSubscription(subscription); |
else |
addSubscription(subscription); |