diff --git a/src/modules/[chain]/uptime/index.vue b/src/modules/[chain]/uptime/index.vue index 6ad6a77f..81a80a8f 100644 --- a/src/modules/[chain]/uptime/index.vue +++ b/src/modules/[chain]/uptime/index.vue @@ -10,6 +10,7 @@ import { import UptimeBar from '@/components/UptimeBar.vue'; import type { Commit, SlashingParam, SigningInfo } from '@/types'; import { consensusPubkeyToHexAddress, pubKeyToValcons, valconsToBase64 } from '@/libs'; +import { lazyKeyElSetMap } from 'lazy-load-vue3/types/listen'; const props = defineProps(['chain']); @@ -107,19 +108,27 @@ onMounted(() => { } }); - chainStore.rpc.getSlashingSigningInfos().then((x) => { - x.info?.forEach((i) => { - signingInfo.value[valconsToBase64(i.address)] = i; - }); - }); + updateTotalSigningInfo(); chainStore.rpc.getSlashingParams().then((x) => { slashingParam.value = x.params; }); }); +function updateTotalSigningInfo() { + chainStore.rpc.getSlashingSigningInfos().then((x) => { + x.info?.forEach((i) => { + signingInfo.value[valconsToBase64(i.address)] = i; + }); + }); +} + const commits2 = computed(() => { const la = baseStore.recents.map((b) => b.block.last_commit); + // trigger update total signing info + if(la.length > 0 && la.at(0)?.height|| 0 % 7 === 0) { + updateTotalSigningInfo(); + }; const all = [...commits.value, ...la]; return all.length > 50 ? all.slice(all.length - 50) : all; });