diff --git a/src/modules/[chain]/consensus/index.vue b/src/modules/[chain]/consensus/index.vue index 970871b2..97f5e267 100644 --- a/src/modules/[chain]/consensus/index.vue +++ b/src/modules/[chain]/consensus/index.vue @@ -28,7 +28,7 @@ onMounted(async () => { // stakingStore.init(); validatorsData.value = await stakingStore.fetchAcitveValdiators(); rpc.value = rpcList.value[0].address + '/consensus_state'; - fetchPosition(); + await fetchPosition(); update(); clearTime() timer = setInterval(() => { @@ -80,12 +80,12 @@ function color(i: number, txt: string) { } return txt === 'nil-Vote' ? 'gray-700' : 'success'; } -function onChange() { +async function onChange () { httpstatus.value = 200; httpStatusText.value = ''; roundState.value = {}; clearTime(); - fetchPosition(); + await fetchPosition(); update(); timer = setInterval(() => { update(); @@ -99,6 +99,7 @@ async function fetchPosition() { if (!response.ok) { throw new Error(`HTTP error: ${response.status}`); } + httpstatus.value = response.status; httpStatusText.value = response.statusText; @@ -115,6 +116,7 @@ async function fetchPosition() { async function update() { rate.value = '0%'; updatetime.value = new Date(); + console.log(httpstatus, 'httpstatus') if (httpstatus.value === 200) { fetch(rpc.value) .then((data) => {