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: Created Nov. 21, 2016, 10:21 a.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') | lib/prefs.js » ('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..71fb6aefdc2bc7e3a91eb382c8f6e865717a4f26 100644
--- a/lib/init.js
+++ b/lib/init.js
@@ -51,18 +51,31 @@ 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_enable_current_locale_subscription)
{
- let subscription = Subscription.fromURL(node.url);
+ // Choose default subscription and add it
Felix Dahlke 2016/11/21 11:41:11 I guess we don't need that comment anymore if the
sergei 2016/11/21 14:03:20 Agree.
+ let subscriptions = require("subscriptions.xml");
+ let node = Utils.chooseFilterSubscription(subscriptions);
+ console.log(node.url);
Felix Dahlke 2016/11/21 11:41:11 Do we want this to stay in here?
sergei 2016/11/21 14:03:20 Sorry, forgot to remove after debugging.
+ if (node)
+ {
+ 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);
+ }
+ }
+ if (Prefs.first_run_enable_acceptable_ads)
+ {
+ let subscription = Subscription.fromURL(Prefs.subscriptions_exceptionsurl);
FilterStorage.addSubscription(subscription);
subscription.disabled = false;
- subscription.title = node.title;
- subscription.homepage = node.homepage;
if (subscription instanceof DownloadableSubscription && !subscription.lastDownload)
- Synchronizer.execute(subscription);
+ Synchronizer.execute(subscription);
+
Felix Dahlke 2016/11/21 11:41:11 Nit: Why add an empty line here?
sergei 2016/11/21 14:03:20 Done.
}
}
« no previous file with comments | « no previous file | lib/prefs.js » ('j') | lib/prefs.js » ('J')

Powered by Google App Engine
This is Rietveld