diff --git a/src/views/components/OperationModal/index.vue b/src/views/components/OperationModal/index.vue index 3e4bf2ba..8283db79 100644 --- a/src/views/components/OperationModal/index.vue +++ b/src/views/components/OperationModal/index.vue @@ -4,37 +4,34 @@ centered size="md" :title="modalTitle" - :ok-title="actionName" scrollable - :hide-header-close="!showResult" + :hide-header-close="false" :hide-footer="showResult" modal-class="custom-transaction-modal" - :ok-disabled="isOwner" @hidden="resetModal" - @ok="handleOk" @show="initialize" > - - - - - Advanced - - - - + @@ -292,10 +305,10 @@ export default { if (this.accounts) { this.updateWallet(this.accounts.device) if (this.accounts.address.findIndex(x => x.addr === this.selectedAddress) > -1) { - return false + return true } } - return true + return false }, selectedAddress() { if (this.address) { @@ -316,30 +329,32 @@ export default { }, methods: { initialize() { - this.$http.getLatestBlock().then(ret => { - this.chainId = ret.block.header.chain_id - const notSynced = timeIn(ret.block.header.time, 10, 'm') - if (notSynced) { - this.error = 'Client is not synced or blockchain is halted' - } else { - this.error = null - } - }) - this.$http.getAuthAccount(this.selectedAddress).then(ret => { - const account = extractAccountNumberAndSequence(ret) - this.accountNumber = account.accountNumber - this.sequence = account.sequence - }) - this.$http.getBankBalances(this.selectedAddress, this.selectedChain).then(res => { - if (res && res.length > 0) { - this.balance = res.reverse() - const token = this.balance.find(i => !i.denom.startsWith('ibc')) - this.token = token.denom - if (token) this.feeDenom = token.denom - } - }) - this.fee = this.$store.state.chains.selected?.min_tx_fee || '1000' - this.feeDenom = this.$store.state.chains.selected?.assets[0]?.base || '' + if (this.selectedAddress) { + this.$http.getLatestBlock().then(ret => { + this.chainId = ret.block.header.chain_id + const notSynced = timeIn(ret.block.header.time, 10, 'm') + if (notSynced) { + this.error = 'Client is not synced or blockchain is halted' + } else { + this.error = null + } + }) + this.$http.getAuthAccount(this.selectedAddress).then(ret => { + const account = extractAccountNumberAndSequence(ret) + this.accountNumber = account.accountNumber + this.sequence = account.sequence + }) + this.$http.getBankBalances(this.selectedAddress, this.selectedChain).then(res => { + if (res && res.length > 0) { + this.balance = res.reverse() + const token = this.balance.find(i => !i.denom.startsWith('ibc')) + this.token = token.denom + if (token) this.feeDenom = token.denom + } + }) + this.fee = this.$store.state.chains.selected?.min_tx_fee || '1000' + this.feeDenom = this.$store.state.chains.selected?.assets[0]?.base || '' + } }, componentUpdate(obj) { Object.keys(obj).forEach(key => {