diff --git a/lib/modules/storage/index.js b/lib/modules/storage/index.js index 24d91be3e..d4bf90699 100644 --- a/lib/modules/storage/index.js +++ b/lib/modules/storage/index.js @@ -26,23 +26,13 @@ class Storage { }); } - /** - * Adds the code to call setProviders in embarkjs after embark is ready - * - * @returns {void} - */ addSetProviders() { const self = this; - // filter list of dapp connections based on available_providers set in config - let hasSwarm = _.contains(this.storageConfig.available_providers, 'swarm'); // don't need to eval this in every loop iteration - // contains valid dapp storage providers - this._validDappProviders = _.filter(this.storageConfig.dappConnection, (conn) => { - return _.contains(self.storageConfig.available_providers, conn.provider) || (conn === '$BZZ' && hasSwarm); - }); - let code = `\nEmbarkJS.Storage.setProviders(${JSON.stringify(this._validDappProviders)});`; + let code = `\nEmbarkJS.Storage.setProviders(${JSON.stringify(this.storageConfig.dappConnection)});`; + let shouldInit = (storageConfig) => { - return (this._validDappProviders !== undefined && this._validDappProviders.length > 0 && storageConfig.enabled === true); + return storageConfig.enabled; }; this.embark.addProviderInit('storage', code, shouldInit);