Permalink
Browse files

issue 24: Global and website styles show up twice

  • Loading branch information...
JasonBarnabe committed Apr 28, 2012
1 parent 56a82fa commit 8c670d0fff213edbdc7749a444dbe2c25c6cc869
Showing with 7 additions and 1 deletion.
  1. +7 −1 stylish-chrome/storage.js
@@ -82,7 +82,7 @@ function getStyles(options, callback) {
}
// now add in global ones
getGlobalStyleIds(function(ids) {
- style_ids = style_ids.concat(ids);
+ style_ids = uniqueArray(style_ids.concat(ids));
loadStyles(style_ids, options.enabled, options.url, callback);
});
});
@@ -93,6 +93,12 @@ function getStyles(options, callback) {
}, reportError);
}
+function uniqueArray(ar) {
+ return ar.filter(function(s, i, a){
+ return i === a.lastIndexOf(s);
+ });
+}
+
function getCache(callback) {
if (isBackground()) {
callback(cachedStyles);

0 comments on commit 8c670d0

Please sign in to comment.