[LN ISP chart] Only show "Tor node excluded" when appropriate

This commit is contained in:
nymkappa 2022-07-27 15:33:25 +02:00
parent 12eea0e4cc
commit f30883a018
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04
2 changed files with 5 additions and 1 deletions

View File

@ -7,7 +7,9 @@
<fa-icon [icon]="['fas', 'download']" [fixedWidth]="true"></fa-icon>
</button>
</div>
<small style="color: #ffffff66" i18n="lightning.tor-nodes-excluded">(Tor nodes excluded)</small>
<small class="d-block" style="color: #ffffff66; min-height: 25px" i18n="lightning.tor-nodes-excluded">
<span *ngIf="!(showTorObservable$ | async)">(Tor nodes excluded)</span>
</small>
</div>
<div class="container pb-lg-0 bottom-padding">

View File

@ -28,6 +28,7 @@ export class NodesPerISPChartComponent implements OnInit {
@HostBinding('attr.dir') dir = 'ltr';
nodesPerAsObservable$: Observable<any>;
showTorObservable$: Observable<boolean>;
groupBySubject = new Subject<boolean>();
showTorSubject = new Subject<boolean>();
@ -44,6 +45,7 @@ export class NodesPerISPChartComponent implements OnInit {
ngOnInit(): void {
this.seoService.setTitle($localize`Lightning nodes per ISP`);
this.showTorObservable$ = this.showTorSubject.asObservable();
this.nodesPerAsObservable$ = combineLatest([this.groupBySubject, this.showTorSubject])
.pipe(
switchMap((selectedFilters) => {