fix stratum websocket un-subscriptions

This commit is contained in:
mononaut 2026-06-30 07:54:52 +00:00
parent b978b8ae4c
commit 3b1db74761
No known key found for this signature in database
GPG key ID: BFD16BE592A9CD8D
2 changed files with 4 additions and 3 deletions

View file

@ -446,7 +446,7 @@ class WebsocketHandler {
delete client['track-mempool'];
}
if (parsedMessage && parsedMessage['track-stratum'] != null) {
if (parsedMessage && parsedMessage['track-stratum'] !== undefined) {
if (parsedMessage['track-stratum'] === 'all' || typeof parsedMessage['track-stratum'] === 'number') {
const sub = parsedMessage['track-stratum'];
client['track-stratum'] = sub;

View file

@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, Inject, Input, LOCALE_ID, OnInit } from '@angular/core';
import { ChangeDetectionStrategy, Component, Inject, Input, LOCALE_ID, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { echarts, EChartsOption } from '@app/graphs/echarts';
import { BehaviorSubject, Observable, Subscription, combineLatest, of } from 'rxjs';
@ -26,7 +26,7 @@ interface AccelerationTotal {
standalone: false,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PoolComponent implements OnInit {
export class PoolComponent implements OnInit, OnDestroy {
@Input() right: number | string = 45;
@Input() left: number | string = 75;
@ -365,5 +365,6 @@ export class PoolComponent implements OnInit {
ngOnDestroy(): void {
this.slugSubscription.unsubscribe();
this.websocketService.stopTrackStratum();
}
}