aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-07-01 20:17:01 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-07-01 20:17:01 +0200
commitbb031a3589755cfb923449de1ed319a181f8f08b (patch)
tree7fa58b51f8b3957beab6024e5394bff883abdb0a
parent7b4a2f872efd94954ce4c54d7d6471e105bc0e72 (diff)
downloadbugzilla-triage-bb031a3589755cfb923449de1ed319a181f8f08b.tar.gz
enabledPackages defaults to all; fixes #14
-rw-r--r--lib/bzpage.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/bzpage.js b/lib/bzpage.js
index eac54af..14dde0e 100644
--- a/lib/bzpage.js
+++ b/lib/bzpage.js
@@ -105,7 +105,15 @@ BZPage.prototype.getInstalledPackages = function getInstalledPackages(cfg) {
if (preferences.isSet(prefName)) {
enabledPackages = preferences.get(prefName,"").split(/[, ]/);
} else {
- preferences.set(prefName,"");
+ console.log("Setting default preference " + prefName + " to 'all'.");
+ preferences.set(prefName,"all");
+ }
+
+ if ((enabledPackages.length === 1) && (enabledPackages[0] === "all")) {
+ enabledPackages = [];
+ for (var key in cfg.gJSONData.commentPackages) {
+ enabledPackages.push(key);
+ }
}
enabledPackages.forEach(function (pkg, idx, arr) {