update: fix unequal update height follow in chains

- anti zero "0" height club

Signed-off-by: Salman Wahib <sxlmnwb@sxlzptprjkt.xyz>
This commit is contained in:
Salman Wahib 2023-02-20 23:48:23 +07:00 committed by GitHub
parent f16c1070a7
commit 7b06ce8df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,7 +175,7 @@ export default {
if (chain.api) {
const index = localStorage.getItem(`${chain.chain_name}-api-index`) || 0
const host = Array.isArray(chain.api) ? chain.api[index] : chain.api
fetch(`${host}/blocks/latest`).then(res => res.json()).then(b => {
fetch(`${host}/cosmos/base/tendermint/v1beta1/blocks/latest`).then(res => res.json()).then(b => {
const { header } = b.block
this.$set(chain, 'height', header.height)
this.$set(chain, 'time', toDay(header.time))