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

Unified Diff: lib/filterStorage.js

Issue 29860589: Issue 6829 - Free filters when subscriptions are empty (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Address PS1 comment Created Aug. 30, 2018, 5:10 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
« no previous file with comments | « no previous file | test/filterStorage.js » ('j') | test/filterStorage.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterStorage.js
===================================================================
--- a/lib/filterStorage.js
+++ b/lib/filterStorage.js
@@ -140,16 +140,21 @@
*/
removeSubscription(subscription)
{
for (let i = 0; i < FilterStorage.subscriptions.length; i++)
{
if (FilterStorage.subscriptions[i].url == subscription.url)
{
removeSubscriptionFilters(subscription);
+ for (let filter of subscription.filters)
+ {
+ if (filter.subscriptions.size == 0)
+ Filter.knownFilters.delete(filter.text);
+ }
FilterStorage.subscriptions.splice(i--, 1);
FilterStorage.knownSubscriptions.delete(subscription.url);
FilterNotifier.triggerListeners("subscription.removed", subscription);
return;
}
}
},
« no previous file with comments | « no previous file | test/filterStorage.js » ('j') | test/filterStorage.js » ('J')

Powered by Google App Engine
This is Rietveld