diff --git a/src/universal-dapp-ui.js b/src/universal-dapp-ui.js index 26fcc393a9..130ab33731 100644 --- a/src/universal-dapp-ui.js +++ b/src/universal-dapp-ui.js @@ -24,6 +24,11 @@ var TreeView = require('./app/ui/TreeView') function UniversalDAppUI (udapp, registry) { this.udapp = udapp this.registry = registry + + this.compilerData = {contractsDetails: {}} + registry.get('compiler').api.event.register('compilationFinished', (success, data, source) => { + this.compilerData.contractsDetails = success && data ? data.contracts : {} + }) } function decodeResponseToTreeView (response, fnabi) { @@ -215,7 +220,7 @@ UniversalDAppUI.prototype.getCallButton = function (args) { } // contractsDetails is used to resolve libraries - txFormat.buildData(args.contractName, args.contractAbi, self.udapp.data.contractsDetails, false, args.funABI, args.funABI.type !== 'fallback' ? value : '', (error, data) => { + txFormat.buildData(args.contractName, args.contractAbi, self.compilerData.contractsDetails, false, args.funABI, args.funABI.type !== 'fallback' ? value : '', (error, data) => { if (!error) { if (!args.funABI.constant) { self.registry.logCallback(`${logMsg} pending ... `) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 56073b0072..bdf89119fe 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -10,7 +10,8 @@ var executionContext = remixLib.execution.executionContext function UniversalDApp (globalRegistry, config) { this.event = new EventManager() - this._deps = { + var self = this + self._deps = { config: globalRegistry.get('config').api, compiler: globalRegistry.get('compiler').api }