FIX: Return sharing sources in the same order as the site setting

This commit is contained in:
Robin Ward 2015-02-12 13:03:32 -05:00
parent 6c65162b05
commit 1eecd7418e
1 changed files with 6 additions and 8 deletions

View File

@ -24,17 +24,15 @@
```
**/
var _sources = [];
var _sources = {};
export default {
addSource: function (source) {
_sources.push(source);
addSource(source) {
_sources[source.id] = source;
},
activeSources: function() {
var enabled = Discourse.SiteSettings.share_links.split('|');
return _sources.filter(function(s) {
return enabled.indexOf(s.id) !== -1;
});
activeSources() {
const enabled = Discourse.SiteSettings.share_links.split('|');
return enabled.map(s => _sources[s]).compact();
}
};