2
0
mirror of https://github.com/Ride-The-Lightning/RTL synced 2024-10-31 09:20:27 +00:00
RTL/src/app/lnd/home/channel-liquidity-info/channel-liquidity-info.component.ts

38 lines
1.0 KiB
TypeScript
Raw Normal View History

import { Component, Input, OnInit, OnDestroy } from '@angular/core';
2020-01-08 23:57:51 +00:00
import { Router } from '@angular/router';
import { Subject } from 'rxjs';
import { Store } from '@ngrx/store';
import { Channel } from '../../../shared/models/lndModels';
import * as fromRTLReducer from '../../../store/rtl.reducers';
@Component({
selector: 'rtl-channel-liquidity-info',
templateUrl: './channel-liquidity-info.component.html',
styleUrls: ['./channel-liquidity-info.component.scss']
})
export class ChannelLiquidityInfoComponent implements OnInit, OnDestroy {
@Input() direction: string;
@Input() totalLiquidity: number;
@Input() allChannels: Channel[];
private targetConf = 6;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject()];
constructor(private router: Router, private store: Store<fromRTLReducer.RTLState>) {}
ngOnInit() {}
2020-01-08 23:57:51 +00:00
goToChannels() {
this.router.navigateByUrl('/lnd/peerschannels');
}
ngOnDestroy() {
this.unSubs.forEach(completeSub => {
completeSub.next();
completeSub.complete();
});
}
}