Bug Fixes 1

Bug Fixes 1
pull/121/head
ShahanaFarooqui 5 years ago
parent 794c2ad5d9
commit ce39d7fa31

2
package-lock.json generated

@ -1,6 +1,6 @@
{
"name": "rtl",
"version": "0.2.17-beta",
"version": "0.3.0-beta",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -1,6 +1,6 @@
{
"name": "rtl",
"version": "0.2.17-beta",
"version": "0.3.0-beta",
"license": "MIT",
"scripts": {
"ng": "ng",

@ -1,7 +1,8 @@
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import { MatTableDataSource, MatSort } from '@angular/material';
import { ClosedChannel } from '../../../shared/models/lndModels';
@ -23,9 +24,9 @@ export class ChannelClosedComponent implements OnInit, OnDestroy {
public flgLoading: Array<Boolean | 'error'> = [true];
public selectedFilter = '';
public flgSticky = false;
private unsub: Array<Subject<void>> = [new Subject(), new Subject()];
private unsub: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private rtlEffects: RTLEffects) {
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private rtlEffects: RTLEffects, private actions$: Actions) {
switch (true) {
case (window.innerWidth <= 415):
this.displayedColumns = ['close_type', 'chan_id', 'settled_balance'];
@ -51,6 +52,9 @@ export class ChannelClosedComponent implements OnInit, OnDestroy {
ngOnInit() {
this.store.dispatch(new RTLActions.FetchChannels({routeParam: 'closed', channelStatus: ''}));
this.actions$.pipe(takeUntil(this.unsub[2]), filter((action) => action.type === RTLActions.RESET_STORE)).subscribe((resetStore: RTLActions.ResetStore) => {
this.store.dispatch(new RTLActions.FetchChannels({routeParam: 'closed', channelStatus: ''}));
});
this.store.select('rtlRoot')
.pipe(takeUntil(this.unsub[0]))
.subscribe((rtlStore: fromRTLReducer.State) => {
@ -59,7 +63,7 @@ export class ChannelClosedComponent implements OnInit, OnDestroy {
this.flgLoading[0] = 'error';
}
});
if (undefined !== rtlStore.closedChannels && rtlStore.closedChannels.length > 0) {
if (undefined !== rtlStore.closedChannels) {
this.loadClosedChannelsTable(rtlStore.closedChannels);
}
if (this.flgLoading[0] !== 'error') {

@ -81,7 +81,7 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
});
this.totalBalance = +rtlStore.blockchainBalance.total_balance;
if (undefined !== rtlStore.allChannels && rtlStore.allChannels.length > 0) {
if (undefined !== rtlStore.allChannels) {
this.loadChannelsTable(rtlStore.allChannels);
}
if (this.flgLoading[0] !== 'error') {

@ -1,7 +1,8 @@
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import { MatTableDataSource, MatSort } from '@angular/material';
import { ForwardingEvent, RoutingPeers } from '../../shared/models/lndModels';
@ -32,9 +33,9 @@ export class RoutingPeersComponent implements OnInit, OnDestroy {
public endDate = this.today;
public startDate = this.lastMonthDay;
public flgSticky = false;
private unsub: Array<Subject<void>> = [new Subject(), new Subject()];
private unsub: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private commonService: CommonService, private store: Store<fromRTLReducer.State>) {
constructor(private logger: LoggerService, private commonService: CommonService, private store: Store<fromRTLReducer.State>, private actions$: Actions) {
switch (true) {
case (window.innerWidth <= 415):
this.displayedColumns = ['chan_id', 'events', 'total_amount'];
@ -58,6 +59,9 @@ export class RoutingPeersComponent implements OnInit, OnDestroy {
ngOnInit() {
this.onRoutingPeersFetch();
this.actions$.pipe(takeUntil(this.unsub[2]), filter((action) => action.type === RTLActions.RESET_STORE)).subscribe((resetStore: RTLActions.ResetStore) => {
this.onRoutingPeersFetch();
});
this.store.select('rtlRoot')
.pipe(takeUntil(this.unsub[0]))
.subscribe((rtlStore: fromRTLReducer.State) => {

@ -1,8 +1,9 @@
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { formatDate } from '@angular/common';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import { MatTableDataSource, MatSort } from '@angular/material';
import { ForwardingEvent } from '../../shared/models/lndModels';
@ -29,7 +30,7 @@ export class ForwardingHistoryComponent implements OnInit, OnDestroy {
public flgSticky = false;
private unsub: Array<Subject<void>> = [new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>) {
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private actions$: Actions) {
switch (true) {
case (window.innerWidth <= 415):
this.displayedColumns = ['timestamp', 'amt_out', 'amt_in'];
@ -53,6 +54,10 @@ export class ForwardingHistoryComponent implements OnInit, OnDestroy {
ngOnInit() {
this.onForwardingHistoryFetch();
this.actions$.pipe(takeUntil(this.unsub[2]), filter((action) => action.type === RTLActions.RESET_STORE)).subscribe((resetStore: RTLActions.ResetStore) => {
this.onForwardingHistoryFetch();
});
this.store.select('rtlRoot')
.pipe(takeUntil(this.unsub[0]))
.subscribe((rtlStore: fromRTLReducer.State) => {

@ -1,8 +1,9 @@
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { formatDate } from '@angular/common';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import { MatTableDataSource, MatSort } from '@angular/material';
import { Transaction } from '../../../shared/models/lndModels';
@ -23,9 +24,9 @@ export class ListTransactionsComponent implements OnInit, OnDestroy {
public listTransactions: any;
public flgLoading: Array<Boolean | 'error'> = [true];
public flgSticky = false;
private unsub: Array<Subject<void>> = [new Subject(), new Subject()];
private unsub: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private rtlEffects: RTLEffects) {
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private rtlEffects: RTLEffects, private actions$: Actions) {
switch (true) {
case (window.innerWidth <= 415):
this.displayedColumns = ['dest_addresses', 'total_fees', 'amount'];
@ -49,6 +50,10 @@ export class ListTransactionsComponent implements OnInit, OnDestroy {
ngOnInit() {
this.store.dispatch(new RTLActions.FetchTransactions());
this.actions$.pipe(takeUntil(this.unsub[2]), filter((action) => action.type === RTLActions.RESET_STORE)).subscribe((resetStore: RTLActions.ResetStore) => {
this.store.dispatch(new RTLActions.FetchTransactions());
});
this.store.select('rtlRoot')
.pipe(takeUntil(this.unsub[0]))
.subscribe((rtlStore: fromRTLReducer.State) => {
@ -57,7 +62,7 @@ export class ListTransactionsComponent implements OnInit, OnDestroy {
this.flgLoading[0] = 'error';
}
});
if (undefined !== rtlStore.transactions && rtlStore.transactions.length > 0) {
if (undefined !== rtlStore.transactions) {
this.loadTransactionsTable(rtlStore.transactions);
}
if (this.flgLoading[0] !== 'error') {

@ -7,6 +7,7 @@ import {
} from '../models/lndModels';
import { MatDialogConfig } from '@angular/material';
export const RESET_STORE = 'RESET_STORE';
export const CLEAR_EFFECT_ERROR = 'CLEAR_EFFECT_ERROR';
export const EFFECT_ERROR = 'EFFECT_ERROR';
export const OPEN_SPINNER = 'OPEN_SPINNER';
@ -112,6 +113,11 @@ export class CloseConfirmation implements Action {
constructor(public payload: boolean) {}
}
export class ResetStore implements Action {
readonly type = RESET_STORE;
constructor(public payload: Node) {}
}
export class FetchRTLConfig implements Action {
readonly type = FETCH_RTL_CONFIG;
}
@ -387,7 +393,7 @@ export type RTLActions =
ClearEffectError | EffectError | OpenSpinner | CloseSpinner |
FetchRTLConfig | SetRTLConfig | SaveSettings |
OpenAlert | CloseAlert | OpenConfirmation | CloseConfirmation |
SetSelelectedNode | FetchInfo | SetInfo |
ResetStore | SetSelelectedNode | FetchInfo | SetInfo |
FetchPeers | SetPeers | AddPeer | DetachPeer | SaveNewPeer | RemovePeer |
AddInvoice | SaveNewInvoice | GetForwardingHistory | SetForwardingHistory |
FetchFees | SetFees |

@ -1050,10 +1050,9 @@ export class RTLEffects implements OnDestroy {
.pipe(
map((postRes: any) => {
this.logger.info(postRes);
setTimeout(() => {
this.store.dispatch(new RTLActions.CloseSpinner());
}, 4000);
this.store.dispatch(new RTLActions.CloseSpinner());
if (sessionStorage.getItem('token')) {
this.store.dispatch(new RTLActions.ResetStore(action.payload));
return { type: RTLActions.FETCH_INFO };
} else {
return {

@ -84,6 +84,12 @@ export function RTLRootReducer(state = initialState, action: RTLActions.RTLActio
...state,
effectErrors: [...state.effectErrors, action.payload]
};
case RTLActions.RESET_STORE:
return {
...initialState,
appConfig: state.appConfig,
selNode: action.payload
};
case RTLActions.SET_SELECTED_NODE:
return {
...state,

Loading…
Cancel
Save