From f03ee64cfa42869c81cbb6a55bf1e7c7bede22e1 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Fri, 28 Oct 2022 13:39:18 +0800 Subject: [PATCH] remove validator cache --- src/libs/fetch.js | 3 ++- src/views/Uptime.vue | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libs/fetch.js b/src/libs/fetch.js index 45825b28..1a455426 100644 --- a/src/libs/fetch.js +++ b/src/libs/fetch.js @@ -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 }) } diff --git a/src/views/Uptime.vue b/src/views/Uptime.vue index 19e81374..1d754f96 100644 --- a/src/views/Uptime.vue +++ b/src/views/Uptime.vue @@ -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 })