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 { export default {
addSource: function (source) { addSource(source) {
_sources.push(source); _sources[source.id] = source;
}, },
activeSources: function() { activeSources() {
var enabled = Discourse.SiteSettings.share_links.split('|'); const enabled = Discourse.SiteSettings.share_links.split('|');
return _sources.filter(function(s) { return enabled.map(s => _sources[s]).compact();
return enabled.indexOf(s.id) !== -1;
});
} }
}; };