fix plugin call

This commit is contained in:
Iuri Matias 2018-07-08 23:41:37 +03:00
parent fd9be8ac84
commit 0c14834e57
2 changed files with 4 additions and 3 deletions

View File

@ -253,7 +253,7 @@ class Engine {
}
storageService(_options) {
this.registerModule('storage');
this.registerModule('storage', {plugins: this.plugins});
this.registerModule('ipfs');
this.registerModule('swarm');
}

View File

@ -1,8 +1,9 @@
class Storage {
constructor(embark, _options){
constructor(embark, options){
this.embark = embark;
this.storageConfig = embark.config.storageConfig;
this.plugins = options.plugins;
if (!this.storageConfig.enabled) return;
@ -15,7 +16,7 @@ class Storage {
this.embark.events.setCommandHandler('storage:upload', (cb) => {
let platform = self.storageConfig.upload.provider;
let uploadCmds = self.embark.getPluginsProperty('uploadCmds', 'uploadCmds');
let uploadCmds = self.plugins.getPluginsProperty('uploadCmds', 'uploadCmds');
for (let uploadCmd of uploadCmds) {
if (uploadCmd.cmd === platform) {
return uploadCmd.cb.call(uploadCmd.cb, cb);