Avoid briefly showing incorrect health value

This commit is contained in:
natsoni 2024-10-05 17:16:00 +09:00
parent 76a1eb12a6
commit 3d27b7e7b4
No known key found for this signature in database
GPG Key ID: C65917583181743B
2 changed files with 2 additions and 3 deletions

View File

@ -66,10 +66,10 @@
[class.badge-success]="blockAudit?.matchRate >= 99" [class.badge-success]="blockAudit?.matchRate >= 99"
[class.badge-warning]="blockAudit?.matchRate >= 75 && blockAudit?.matchRate < 99" [class.badge-warning]="blockAudit?.matchRate >= 75 && blockAudit?.matchRate < 99"
[class.badge-danger]="blockAudit?.matchRate < 75" [class.badge-danger]="blockAudit?.matchRate < 75"
*ngIf="blockAudit?.matchRate != null; else nullHealth" *ngIf="blockAudit?.matchRate != null && blockAudit?.id === block.id; else nullHealth"
>{{ blockAudit?.matchRate }}%</span> >{{ blockAudit?.matchRate }}%</span>
<ng-template #nullHealth> <ng-template #nullHealth>
<ng-container *ngIf="!isLoadingOverview; else loadingHealth"> <ng-container *ngIf="!isLoadingOverview && blockAudit?.id === block.id; else loadingHealth">
<span class="health-badge badge badge-secondary" i18n="unknown">Unknown</span> <span class="health-badge badge badge-secondary" i18n="unknown">Unknown</span>
</ng-container> </ng-container>
</ng-template> </ng-template>

View File

@ -163,7 +163,6 @@ export class BlockComponent implements OnInit, OnDestroy {
this.block = undefined; this.block = undefined;
this.error = undefined; this.error = undefined;
this.fees = undefined; this.fees = undefined;
this.blockAudit = undefined;
this.oobFees = 0; this.oobFees = 0;
if (history.state.data && history.state.data.blockHeight) { if (history.state.data && history.state.data.blockHeight) {