|
|
|
@ -96,13 +96,15 @@ var css = csjs` |
|
|
|
|
/* |
|
|
|
|
trigger debugRequested |
|
|
|
|
*/ |
|
|
|
|
function UniversalDApp (options) { |
|
|
|
|
function UniversalDApp (opts = {}) { |
|
|
|
|
this.event = new EventManager() |
|
|
|
|
var self = this |
|
|
|
|
|
|
|
|
|
self.options = options || {} |
|
|
|
|
self._api = opts.api |
|
|
|
|
self.removable = opts.opt.removable |
|
|
|
|
self.removable_instance = opts.opt.removable_instance |
|
|
|
|
self.el = yo`<div class="udapp"></div>` |
|
|
|
|
self.personalMode = self.options.personalMode || false |
|
|
|
|
self.personalMode = opts.opt.personalMode || false |
|
|
|
|
self.contracts |
|
|
|
|
self.transactionContextAPI |
|
|
|
|
executionContext.event.register('contextChanged', this, function (context) { |
|
|
|
@ -229,8 +231,7 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa |
|
|
|
|
<div class="${css.titleText}"> ${contractName} at ${shortAddress} (${context}) </div> |
|
|
|
|
<i class="fa fa-clipboard ${css.copy}" aria-hidden="true" onclick=${copyToClipboard} title='Copy to clipboard'></i> |
|
|
|
|
</div>` |
|
|
|
|
|
|
|
|
|
if (this.options.removable_instances) { |
|
|
|
|
if (this.removable_instance) { |
|
|
|
|
var close = yo`<div class="${css.udappClose}" onclick=${remove}><i class="${css.closeIcon} fa fa-close" aria-hidden="true"></i></div>` |
|
|
|
|
title.appendChild(close) |
|
|
|
|
} |
|
|
|
@ -308,6 +309,7 @@ UniversalDApp.prototype.getCallButton = function (args) { |
|
|
|
|
if (!error) { |
|
|
|
|
txExecution.callFunction(args.address, data, args.funABI, self, (error, txResult) => { |
|
|
|
|
if (!error) { |
|
|
|
|
self._api.logMessage('UDApp transaction added ...') |
|
|
|
|
var isVM = executionContext.isVM() |
|
|
|
|
if (isVM) { |
|
|
|
|
var vmError = txExecution.checkVMError(txResult) |
|
|
|
|