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