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

33 lines
1021 B
TypeScript
Raw Normal View History

import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
2021-12-09 07:44:49 -05:00
import { Env, StateService } from 'src/app/services/state.service';
@Component({
selector: 'app-docs',
templateUrl: './docs.component.html',
styleUrls: ['./docs.component.scss']
})
export class DocsComponent implements OnInit {
activeTab = 0;
2021-12-09 07:44:49 -05:00
env: Env;
showWebSocketTab = true;
constructor(
private route: ActivatedRoute,
2021-12-09 07:44:49 -05:00
private stateService: StateService,
) { }
ngOnInit(): void {
const url = this.route.snapshot.url;
this.activeTab = ( url[2].path === "rest" ) ? 0 : 1;
2021-12-09 07:44:49 -05:00
this.env = this.stateService.env;
this.showWebSocketTab = ( ! ( ( this.env.BASE_MODULE === "bisq" ) || ( this.stateService.network === "bisq" ) || ( this.stateService.network === "liquidtestnet" ) ) );
2022-03-30 09:44:41 -04:00
document.querySelector<HTMLElement>( "html" ).style.scrollBehavior = "smooth";
}
ngOnDestroy(): void {
document.querySelector<HTMLElement>( "html" ).style.scrollBehavior = "auto";
}
}