diff options
author | Matěj Cepl <mcepl@redhat.com> | 2010-07-01 20:17:01 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2010-07-01 20:17:01 +0200 |
commit | bb031a3589755cfb923449de1ed319a181f8f08b (patch) | |
tree | 7fa58b51f8b3957beab6024e5394bff883abdb0a /lib/bzpage.js | |
parent | 7b4a2f872efd94954ce4c54d7d6471e105bc0e72 (diff) | |
download | bugzilla-triage-bb031a3589755cfb923449de1ed319a181f8f08b.tar.gz |
enabledPackages defaults to all; fixes #14
Diffstat (limited to 'lib/bzpage.js')
-rw-r--r-- | lib/bzpage.js | 10 |
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) { |