From d1a207941da33201e3824e5322cf65b6984403e3 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 29 Dec 2017 16:11:45 -0500 Subject: [PATCH] take into account available providers list --- lib/contracts/code_generator.js | 2 +- lib/modules/ipfs/index.js | 4 +++- lib/modules/whisper/index.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/contracts/code_generator.js b/lib/contracts/code_generator.js index d8744afdc..2b08c2453 100644 --- a/lib/contracts/code_generator.js +++ b/lib/contracts/code_generator.js @@ -289,7 +289,7 @@ class CodeGenerator { let embarkjsCode = fs.readFileSync(fs.embarkPath('js/embark.js')).toString(); let code = ""; - code += "\nimport Web3 from '" + utils.joinPath(fs.embarkPath("js/web3-1.0.min.js")) + "'\n"; + code += "\nimport Web3 from '" + utils.joinPath(fs.embarkPath("js/web3-1.0.min.js")) + "';\n"; code += "\nimport web3 from 'Embark/web3';\n"; code += "\n" + embarkjsCode + "\n"; diff --git a/lib/modules/ipfs/index.js b/lib/modules/ipfs/index.js index 0b9e146a1..f3685c7e1 100644 --- a/lib/modules/ipfs/index.js +++ b/lib/modules/ipfs/index.js @@ -86,10 +86,12 @@ class IPFS { } addIPFSToEmbarkJS() { + // TODO: make this a shouldAdd condition if (this.storageConfig === {}) { return; } - if(this.storageConfig.provider !== 'ipfs' || this.storageConfig.enabled !== true) { + + if ((this.storageConfig.available_providers.indexOf('ipfs') < 0) && (this.storageConfig.provider !== 'ipfs' || this.storageConfig.enabled !== true)) { return; } diff --git a/lib/modules/whisper/index.js b/lib/modules/whisper/index.js index 979fe3c88..3b848f422 100644 --- a/lib/modules/whisper/index.js +++ b/lib/modules/whisper/index.js @@ -34,7 +34,7 @@ class Whisper { if (this.communicationConfig === {}) { return; } - if(this.communicationConfig.provider !== 'whisper' || this.communicationConfig.enabled !== true) { + if ((this.communicationConfig.available_providers.indexOf('whisper') < 0) && (this.communicationConfig.provider !== 'whisper' || this.communicationConfig.enabled !== true)) { return; }