Merge pull request #5566 from mempool/natsoni/fix-block-health-display

Avoid briefly showing incorrect health value
This commit is contained in:
softsimon 2024-10-05 02:38:11 -06:00 committed by GitHub
commit ba167c9cc2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -66,10 +66,10 @@
[class.badge-success]="blockAudit?.matchRate >= 99"
[class.badge-warning]="blockAudit?.matchRate >= 75 && blockAudit?.matchRate < 99"
[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>
<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>
</ng-container>
</ng-template>

View File

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