diff --git a/src/views/Home.vue b/src/views/Home.vue index 061666a0..89aa3024 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -159,8 +159,10 @@ export default { fetch() { Object.keys(this.chains).forEach(k => { const chain = this.chains[k] + const index = localStorage.getItem(`${chain.chain_name}-api-index`) || 0 if (chain.api) { - fetch(`${chain.api}/blocks/latest`).then(res => res.json()).then(b => { + const host = Array.isArray(chain.api) ? chain.api[index] : chain.api + fetch(`${host}/blocks/latest`).then(res => res.json()).then(b => { // console.log(b.block.header) const { header } = b.block this.$set(chain, 'height', header.height)