Index: firstRun.js |
=================================================================== |
--- a/firstRun.js |
+++ b/firstRun.js |
@@ -247,20 +247,23 @@ |
{ |
ext.backgroundPage.sendMessage({type: "app.options"}); |
} |
function updateToggleButtons() |
{ |
ext.backgroundPage.sendMessage({type: "subscriptions.get"}, function(subscriptions) |
{ |
+ var known = Object.create(null); |
+ for (var i = 0; i < subscriptions.length; i++) |
+ known[subscriptions[i].url] = true; |
for (var i = 0; i < featureSubscriptions.length; i++) |
{ |
var featureSubscription = featureSubscriptions[i]; |
- updateToggleButton(featureSubscription.feature, subscriptions.indexOf(featureSubscription.url) >= 0); |
+ updateToggleButton(featureSubscription.feature, featureSubscription.url in known); |
} |
}); |
} |
function updateToggleButton(feature, isEnabled) |
{ |
var button = E("toggle-" + feature); |
if (isEnabled) |