remove validator cache

This commit is contained in:
liangping 2022-10-28 13:39:18 +08:00
parent cb7a3321d6
commit f03ee64cfa
2 changed files with 6 additions and 5 deletions

View File

@ -185,7 +185,8 @@ export default class ChainFetch {
async getValidatorList(config = null) {
return this.get('/cosmos/staking/v1beta1/validators?pagination.limit=200&status=BOND_STATUS_BONDED', config).then(data => {
const vals = commonProcess(data.validators).map(i => new Validator().init(i))
localStorage.setItem(`validators-${this.config.chain_name}`, JSON.stringify(vals))
// disable cache
// localStorage.setItem(`validators-${this.config.chain_name}`, JSON.stringify(vals))
return vals
})
}

View File

@ -279,10 +279,10 @@ export default {
},
},
created() {
const cached = JSON.parse(getCachedValidators(this.$route.params.chain))
if (cached) {
this.validators = cached
}
// const cached = JSON.parse(getCachedValidators(this.$route.params.chain))
// if (cached) {
// this.validators = cached
// }
this.$http.getValidatorList().then(res => {
this.validators = res
})