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 {
|
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;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue