Dynamic provider support
This commit is contained in:
@@ -219,10 +219,22 @@ class MountItems extends IPCContainer {
|
||||
}
|
||||
};
|
||||
|
||||
getProviderList = () => {
|
||||
getProviderList = providersOnly => {
|
||||
const providerList = Constants.PROVIDER_LIST.filter(i => {
|
||||
return ((i === 'GooboxS3') && this.props.gooboxS3Supported) ||
|
||||
((i === 'Skynet') && this.props.skynetSupported) ||
|
||||
((i === 'ScPrime') && this.props.scPrimeSupported) ||
|
||||
((i !== 'GooboxS3') && (i !== 'Skynet') && (i !== 'ScPrime'));
|
||||
});
|
||||
|
||||
let remoteList = [];
|
||||
if (this.props.remoteSupported && !providersOnly) {
|
||||
remoteList = [...this.props.RemoteMounts];
|
||||
}
|
||||
|
||||
return [
|
||||
...Constants.PROVIDER_LIST,
|
||||
...this.props.RemoteMounts,
|
||||
...providerList,
|
||||
...remoteList,
|
||||
];
|
||||
};
|
||||
|
||||
@@ -341,7 +353,7 @@ class MountItems extends IPCContainer {
|
||||
}
|
||||
|
||||
let items = [];
|
||||
for (const provider of Constants.PROVIDER_LIST) {
|
||||
for (const provider of this.getProviderList(true)) {
|
||||
items.push((
|
||||
<MountItem allowRemove={false}
|
||||
browseClicked={this.handleBrowseLocation}
|
||||
|
||||
Reference in New Issue
Block a user