Dynamic provider support

This commit is contained in:
2020-04-23 13:56:09 -05:00
parent d7aaab1d31
commit 4fbb1105a5
3 changed files with 31 additions and 5 deletions

View File

@@ -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}