filter empty signature

This commit is contained in:
Pham Tu 2024-01-24 11:04:49 +07:00
parent 727cc6aeb1
commit 9d0cc96ff8
No known key found for this signature in database
GPG Key ID: 7460FD99133ADA1C
2 changed files with 11 additions and 10 deletions

View File

@ -20,12 +20,20 @@ const height = computed(() => {
return Number(current.value.block?.header?.height || props.height || 0);
});
const commit = computed(()=>{
const lastCommit = current.value.block?.lastCommit;
if(lastCommit){
Object.assign(lastCommit,{signatures : lastCommit.signatures.filter(c=>c.signature)})
}
return lastCommit;
})
const isFutureBlock = computed({
get: () => {
const latest = store.latest?.block?.header.height
const isFuture = latest ? target.value > Number(latest) : true
if (!isFuture && !current.value.blockId) store.fetchBlock(target.value).then(x => {
current.value = x;
current.value = x;
})
return isFuture
},
@ -58,7 +66,7 @@ function updateTarget() {
onBeforeRouteUpdate(async (to, from, next) => {
if (from.path !== to.path) {
store.fetchBlock(String(to.params.height)).then(x => {
current.value = x;
current.value = x;
});
next();
}
@ -140,7 +148,7 @@ onBeforeRouteUpdate(async (to, from, next) => {
<div class="bg-base-100 px-4 pt-3 pb-4 rounded shadow">
<h2 class="card-title flex flex-row justify-between">{{ $t('block.last_commit') }}</h2>
<DynamicComponent :value="current.block?.lastCommit" />
<DynamicComponent :value="commit" />
</div>
</div>
</div></template>

View File

@ -870,10 +870,3 @@ function mapDelegators(messages: any[]) {
</div>
</div>
</template>
<style>
.validatore-table.table :where(th, td) {
padding: 0.6rem 1rem;
font-size: 14px;
}
</style>