Merge pull request #4752 from mempool/mononaut/loading-goggles

Fix stuck Goggles on websocket reconnect
This commit is contained in:
wiz 2024-03-09 13:49:48 +09:00 committed by GitHub
commit 00d8241dd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 6 deletions

View file

@ -3,7 +3,7 @@
<div class="block-overview-graph">
<canvas class="block-overview-canvas" [class.clickable]="!!hoverTx" #blockCanvas></canvas>
<div class="loader-wrapper" [class.hidden]="(!isLoading || disableSpinner) && !unavailable">
<div *ngIf="isLoading" class="spinner-border ml-3 loading" role="status"></div>
<div *ngIf="!unavailable" class="spinner-border ml-3 loading" role="status"></div>
<div *ngIf="!isLoading && unavailable" class="ml-3" i18n="block.not-available">not available</div>
</div>
<app-block-overview-tooltip

View file

@ -60,6 +60,5 @@
&.hidden {
opacity: 0;
transition: opacity 500ms;
}
}

View file

@ -236,7 +236,7 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewInit {
acc.unshift(stats);
acc = acc.slice(0, 120);
return acc;
}, mempoolStats)
}, (mempoolStats || []))
),
of(mempoolStats)
);

View file

@ -116,7 +116,7 @@ export class WebsocketService {
this.startMultiTrackTransaction(this.trackingTxId);
}
if (this.isTrackingMempoolBlock) {
this.startTrackMempoolBlock(this.trackingMempoolBlock);
this.startTrackMempoolBlock(this.trackingMempoolBlock, true);
}
if (this.isTrackingRbf) {
this.startTrackRbf(this.isTrackingRbf);
@ -197,9 +197,9 @@ export class WebsocketService {
this.websocketSubject.next({ 'track-asset': 'stop' });
}
startTrackMempoolBlock(block: number) {
startTrackMempoolBlock(block: number, force: boolean = false) {
// skip duplicate tracking requests
if (this.trackingMempoolBlock !== block) {
if (force || this.trackingMempoolBlock !== block) {
this.websocketSubject.next({ 'track-mempool-block': block });
this.isTrackingMempoolBlock = true;
this.trackingMempoolBlock = block;