optimize wallet

This commit is contained in:
liangping 2022-04-13 16:57:19 +08:00
parent e534b51187
commit e6fec8ab7b

View File

@ -125,6 +125,13 @@
<small>{{ item.address ? formatAddr(item.address.addr) : `Not available on ${selected_chain.chain_name}` }}</small>
</div>
</b-dropdown-item>
<b-dropdown-item to="/wallet/import">
<feather-icon
icon="PlusIcon"
size="16"
/>
<span class="align-middle ml-50">Import Address</span>
</b-dropdown-item>
<b-dropdown-divider />
<b-dropdown-item :to="{ name: 'accounts' }">
@ -239,10 +246,10 @@ export default {
let accounts = getLocalAccounts() || {}
accounts = Object.entries(accounts).map(v => ({ wallet: v[0], address: v[1].address.find(x => x.chain === this.selected_chain.chain_name) }))
if (!this.$store.state.chains.defaultWallet && accounts.length > 0) {
if (accounts.length > 0) {
this.updateDefaultWallet(accounts[0].wallet)
}
return accounts
return accounts.filter(x => x.address)
},
},
mounted() {