fix duplicated load

This commit is contained in:
liangping 2023-02-07 20:47:54 +08:00
parent 7683cca288
commit 5dab0d6adf

View File

@ -117,7 +117,7 @@
<span class="font-weight-bolder">
{{ item.wallet }}
<b-badge
v-for="(name, i) in names[item.address.addr]"
v-for="(name, i) in domains[item.address.addr]"
:key="i"
v-b-tooltip.hover.top="name.provider"
variant="primary"
@ -243,9 +243,13 @@ export default {
index: 0,
chainid: '',
names: {},
loading: [],
}
},
computed: {
domains() {
return this.names
},
walletName() {
const key = this.$store?.state?.chains?.defaultWallet
return key || 'Wallet'
@ -286,6 +290,8 @@ export default {
},
methods: {
formatAddr(v) {
if (!this.loading.includes(v)) {
this.loading.push(v)
this.$http.resolveStarName(v).then(res => {
const name = {
name: res.data,
@ -310,6 +316,7 @@ export default {
}
}
})
}
return v.substring(0, 10).concat('...', v.substring(v.length - 10))
},
updateDefaultWallet(v) {