|
|
@ -7,12 +7,14 @@ const copyToClipboard = require('../../ui/copy-to-clipboard') |
|
|
|
const modalDialogCustom = require('../../ui/modal-dialog-custom') |
|
|
|
const modalDialogCustom = require('../../ui/modal-dialog-custom') |
|
|
|
const addTooltip = require('../../ui/tooltip') |
|
|
|
const addTooltip = require('../../ui/tooltip') |
|
|
|
const helper = require('../../../lib/helper.js') |
|
|
|
const helper = require('../../../lib/helper.js') |
|
|
|
|
|
|
|
const globalRegistry = require('../../../global/registry') |
|
|
|
|
|
|
|
|
|
|
|
class SettingsUI { |
|
|
|
class SettingsUI { |
|
|
|
|
|
|
|
|
|
|
|
constructor (settings) { |
|
|
|
constructor (settings) { |
|
|
|
this.settings = settings |
|
|
|
this.settings = settings |
|
|
|
this.event = new EventManager() |
|
|
|
this.event = new EventManager() |
|
|
|
|
|
|
|
this._components = {} |
|
|
|
|
|
|
|
|
|
|
|
this.settings.event.register('transactionExecuted', (error, from, to, data, lookupOnly, txResult) => { |
|
|
|
this.settings.event.register('transactionExecuted', (error, from, to, data, lookupOnly, txResult) => { |
|
|
|
if (error) return |
|
|
|
if (error) return |
|
|
@ -20,6 +22,11 @@ class SettingsUI { |
|
|
|
this.updateAccountBalances() |
|
|
|
this.updateAccountBalances() |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this._components.registry = globalRegistry |
|
|
|
|
|
|
|
this._deps = { |
|
|
|
|
|
|
|
networkModule: this._components.registry.get('network').api |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setInterval(() => { |
|
|
|
setInterval(() => { |
|
|
|
this.updateAccountBalances() |
|
|
|
this.updateAccountBalances() |
|
|
|
}, 10 * 1000) |
|
|
|
}, 10 * 1000) |
|
|
@ -239,7 +246,8 @@ class SettingsUI { |
|
|
|
this.netUI.innerHTML = 'can\'t detect network ' |
|
|
|
this.netUI.innerHTML = 'can\'t detect network ' |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
this.netUI.innerHTML = `${name} (${id || '-'}) network` |
|
|
|
let network = this._deps.networkModule.getNetworkProvider |
|
|
|
|
|
|
|
this.netUI.innerHTML = (network() !== 'vm') ? `${name} (${id || '-'}) network` : '' |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|