FIX: Return sharing sources in the same order as the site setting
This commit is contained in:
parent
6c65162b05
commit
1eecd7418e
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue