fix references to udapp variables

pull/3094/head
Iuri Matias 7 years ago
parent 5402f54788
commit 687582c6e1
  1. 14
      src/universal-dapp-ui.js
  2. 4
      src/universal-dapp.js

@ -183,7 +183,7 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
${copyToClipboard(() => address)} ${copyToClipboard(() => address)}
</div>` </div>`
if (self.removable_instances) { if (self.udapp.removable_instances) {
var close = yo`<div class="${css.udappClose}" onclick=${remove}><i class="${css.closeIcon} fa fa-close" aria-hidden="true"></i></div>` var close = yo`<div class="${css.udappClose}" onclick=${remove}><i class="${css.closeIcon} fa fa-close" aria-hidden="true"></i></div>`
instance.append(close) instance.append(close)
} }
@ -268,9 +268,9 @@ UniversalDAppUI.prototype.getCallButton = function (args) {
if (!error) { if (!error) {
if (isUserAction) { if (isUserAction) {
if (!args.funABI.constant) { if (!args.funABI.constant) {
self._api.logMessage(`${logMsg} pending ... `) self.udapp._api.logMessage(`${logMsg} pending ... `)
} else { } else {
self._api.logMessage(`${logMsg}`) self.udapp._api.logMessage(`${logMsg}`)
} }
} }
txExecution.callFunction(args.address, data, args.funABI, self, (error, txResult) => { txExecution.callFunction(args.address, data, args.funABI, self, (error, txResult) => {
@ -279,7 +279,7 @@ UniversalDAppUI.prototype.getCallButton = function (args) {
if (isVM) { if (isVM) {
var vmError = txExecution.checkVMError(txResult) var vmError = txExecution.checkVMError(txResult)
if (vmError.error) { if (vmError.error) {
self._api.logMessage(`${logMsg} errored: ${vmError.message} `) self.udapp._api.logMessage(`${logMsg} errored: ${vmError.message} `)
return return
} }
} }
@ -289,14 +289,14 @@ UniversalDAppUI.prototype.getCallButton = function (args) {
outputOverride.appendChild(decoded) outputOverride.appendChild(decoded)
} }
} else { } else {
self._api.logMessage(`${logMsg} errored: ${error} `) self.udapp._api.logMessage(`${logMsg} errored: ${error} `)
} }
}) })
} else { } else {
self._api.logMessage(`${logMsg} errored: ${error} `) self.udapp._api.logMessage(`${logMsg} errored: ${error} `)
} }
}, (msg) => { }, (msg) => {
self._api.logMessage(msg) self.udapp._api.logMessage(msg)
}) })
} }

@ -25,8 +25,8 @@ function UniversalDAppModel (opts = {}) {
self.removable = opts.opt.removable self.removable = opts.opt.removable
self.removable_instances = opts.opt.removable_instances self.removable_instances = opts.opt.removable_instances
self.personalMode = opts.opt.personalMode || false self.personalMode = opts.opt.personalMode || false
self.contracts // self.contracts
self.transactionContextAPI // self.transactionContextAPI
executionContext.event.register('contextChanged', this, function (context) { executionContext.event.register('contextChanged', this, function (context) {
self.reset(self.contracts) self.reset(self.contracts)
}) })

Loading…
Cancel
Save