mempool/frontend/src/app/components/about/about.component.ts

37 lines
1.2 KiB
TypeScript
Raw Normal View History

import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { WebsocketService } from '../../services/websocket.service';
2020-03-23 18:52:08 +01:00
import { SeoService } from 'src/app/services/seo.service';
import { StateService } from 'src/app/services/state.service';
import { Observable } from 'rxjs';
import { MemPoolState } from 'src/app/interfaces/websocket.interface';
2019-07-21 16:59:47 +02:00
@Component({
selector: 'app-about',
templateUrl: './about.component.html',
styleUrls: ['./about.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
2019-07-21 16:59:47 +02:00
})
export class AboutComponent implements OnInit {
active = 1;
hostname = document.location.hostname;
mempoolStats$: Observable<MemPoolState>;
2019-07-21 16:59:47 +02:00
constructor(
private websocketService: WebsocketService,
2020-03-23 18:52:08 +01:00
private seoService: SeoService,
private stateService: StateService,
) { }
2019-07-21 16:59:47 +02:00
ngOnInit() {
this.mempoolStats$ = this.stateService.mempoolStats$;
2020-03-23 18:52:08 +01:00
this.seoService.setTitle('Contributors');
2020-02-17 14:39:20 +01:00
this.websocketService.want(['blocks']);
if (this.stateService.network === 'bisq') {
this.active = 2;
}
2020-07-18 13:46:33 +02:00
if (document.location.port !== '') {
this.hostname = this.hostname + ':' + document.location.port;
}
2019-07-21 16:59:47 +02:00
}
}