diff --git a/src/layouts/components/Navbar.vue b/src/layouts/components/Navbar.vue index 1286bb4b..f24fc5e4 100644 --- a/src/layouts/components/Navbar.vue +++ b/src/layouts/components/Navbar.vue @@ -110,19 +110,23 @@ v-for="(item,k) in accounts" :key="k" :disabled="!item.address" - :to="`/${selected_chain.chain_name}/account/${item.address.addr}`" @click="updateDefaultWallet(item.wallet)" >
- {{ item.wallet }} - - - - +
+ {{ item.wallet }} + + + + + + + +
{{ item.address ? formatAddr(item.address.addr) : `Not available on ${selected_chain.chain_name}` }}
diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 9e6a017f..d7af52c8 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -248,6 +248,16 @@ export default { computed: { walletName() { const key = this.$store?.state?.chains?.defaultWallet + if (key) { + const accounts = getLocalAccounts() || {} + const account = Object.entries(accounts) + .map(v => ({ wallet: v[0], address: v[1].address.find(x => x.chain === this.$store.state.chains.selected.chain_name) })) + .filter(v => v.address) + .find(x => x.wallet === key) + if (account) { + this.fetchAccount(account.address.addr) + } + } return key || 'Wallet' }, }, @@ -290,15 +300,6 @@ export default { this.$http.getGovernanceListByStatus(2).then(res => { this.proposals = res.proposals }) - - const accounts = getLocalAccounts() || {} - const account = Object.entries(accounts) - .map(v => ({ wallet: v[0], address: v[1].address.find(x => x.chain === this.$store.state.chains.selected.chain_name) })) - .filter(v => v.address) - .find(x => x.wallet === this.walletName) - if (account) { - this.fetchAccount(account.address.addr) - } }, methods: { formatToken(tokens) {