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

Unified Diff: lib/init.js

Issue 29363607: Issue 4612 - enable AA on first run and make automatic adding of any subscription optional (Closed)
Patch Set: address comments Created Nov. 22, 2016, 12:22 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 | lib/prefs.js » ('j') | test/FilterEngine.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/init.js
diff --git a/lib/init.js b/lib/init.js
index 197321802ae68e4204334f26b8b0a870816530a0..6d605ffbee3fd430d27fbc440d3b17068d4d89e1 100644
--- a/lib/init.js
+++ b/lib/init.js
@@ -51,18 +51,25 @@ FilterNotifier.addListener(function(action)
let {Prefs} = require("prefs");
let {Utils} = require("utils");
- // Choose default subscription and add it
- let subscriptions = require("subscriptions.xml");
- let node = Utils.chooseFilterSubscription(subscriptions);
- if (node)
+ if (Prefs.first_run_subscription_auto_select)
{
- let subscription = Subscription.fromURL(node.url);
- FilterStorage.addSubscription(subscription);
- subscription.disabled = false;
- subscription.title = node.title;
- subscription.homepage = node.homepage;
- if (subscription instanceof DownloadableSubscription && !subscription.lastDownload)
- Synchronizer.execute(subscription);
+ let subscriptions = require("subscriptions.xml");
+ let node = Utils.chooseFilterSubscription(subscriptions);
+ if (node)
+ {
+ let subscription = Subscription.fromURL(node.url);
+ FilterStorage.addSubscription(subscription);
Felix Dahlke 2016/11/22 17:37:16 Nit: Seems we do this after setting the subscripti
sergei 2016/11/23 14:20:50 Completely agree, fixed.
+ subscription.disabled = false;
+ subscription.title = node.title;
+ subscription.homepage = node.homepage;
+ if (subscription instanceof DownloadableSubscription && !subscription.lastDownload)
+ Synchronizer.execute(subscription);
+ }
+ let aaSubscription = Subscription.fromURL(Prefs.subscriptions_exceptionsurl);
Felix Dahlke 2016/11/22 17:37:16 Nit: Mind adding an empty line above this to separ
sergei 2016/11/23 14:20:50 Done.
+ FilterStorage.addSubscription(aaSubscription);
+ aaSubscription.disabled = false;
+ if (aaSubscription instanceof DownloadableSubscription && !aaSubscription.lastDownload)
+ Synchronizer.execute(aaSubscription);
}
}
« no previous file with comments | « no previous file | lib/prefs.js » ('j') | test/FilterEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld