take into account available providers list

This commit is contained in:
Iuri Matias 2017-12-29 16:11:45 -05:00
parent cb5230f569
commit d1a207941d
3 changed files with 5 additions and 3 deletions

View File

@ -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";

View File

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

View File

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