Routing peers bug fix

Routing peers bug fix
pull/98/head
ShahanaFarooqui 5 years ago
parent 76e3d16699
commit 6eb104a36c

@ -8,5 +8,5 @@
<link rel="stylesheet" href="styles.bab7f62b489f0c86770d.css"></head> <link rel="stylesheet" href="styles.bab7f62b489f0c86770d.css"></head>
<body> <body>
<rtl-app></rtl-app> <rtl-app></rtl-app>
<script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script><script type="text/javascript" src="polyfills.181b5a67c421a167a96a.js"></script><script type="text/javascript" src="main.3a3051f31e385ca5b4e2.js"></script></body> <script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script><script type="text/javascript" src="polyfills.181b5a67c421a167a96a.js"></script><script type="text/javascript" src="main.84473d627eea13535d51.js"></script></body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -57,7 +57,7 @@ export class RoutingPeersComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
this.store.dispatch(new RTLActions.GetForwardingHistory({})); this.onRoutingPeersFetch();
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsub[0])) .pipe(takeUntil(this.unsub[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromRTLReducer.State) => {
@ -68,6 +68,9 @@ export class RoutingPeersComponent implements OnInit, OnDestroy {
}); });
if (undefined !== rtlStore.forwardingHistory && undefined !== rtlStore.forwardingHistory.forwarding_events) { if (undefined !== rtlStore.forwardingHistory && undefined !== rtlStore.forwardingHistory.forwarding_events) {
this.loadRoutingPeersTable(rtlStore.forwardingHistory.forwarding_events); this.loadRoutingPeersTable(rtlStore.forwardingHistory.forwarding_events);
} else {
// To reset table after other Forwarding history calls
this.loadRoutingPeersTable([]);
} }
if (this.flgLoading[0] !== 'error') { if (this.flgLoading[0] !== 'error') {
this.flgLoading[0] = (undefined !== rtlStore.forwardingHistory) ? false : true; this.flgLoading[0] = (undefined !== rtlStore.forwardingHistory) ? false : true;
@ -96,13 +99,19 @@ export class RoutingPeersComponent implements OnInit, OnDestroy {
} }
loadRoutingPeersTable(forwardingEvents: ForwardingEvent[]) { loadRoutingPeersTable(forwardingEvents: ForwardingEvent[]) {
const results = this.groupRoutingPeers(forwardingEvents); if (forwardingEvents.length > 0) {
this.RoutingPeersIncoming = new MatTableDataSource<RoutingPeers>(results[0]); const results = this.groupRoutingPeers(forwardingEvents);
this.RoutingPeersIncoming.sort = this.sortIn; this.RoutingPeersIncoming = new MatTableDataSource<RoutingPeers>(results[0]);
this.logger.info(this.RoutingPeersIncoming); this.RoutingPeersIncoming.sort = this.sortIn;
this.RoutingPeersOutgoing = new MatTableDataSource<RoutingPeers>(results[1]); this.logger.info(this.RoutingPeersIncoming);
this.RoutingPeersOutgoing.sort = this.sortOut; this.RoutingPeersOutgoing = new MatTableDataSource<RoutingPeers>(results[1]);
this.logger.info(this.RoutingPeersOutgoing); this.RoutingPeersOutgoing.sort = this.sortOut;
this.logger.info(this.RoutingPeersOutgoing);
} else {
// To reset table after other Forwarding history calls
this.RoutingPeersIncoming = new MatTableDataSource<RoutingPeers>([]);
this.RoutingPeersOutgoing = new MatTableDataSource<RoutingPeers>([]);
}
} }
groupRoutingPeers(forwardingEvents: ForwardingEvent[]) { groupRoutingPeers(forwardingEvents: ForwardingEvent[]) {

@ -52,7 +52,7 @@ export class ForwardingHistoryComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
this.store.dispatch(new RTLActions.GetForwardingHistory({})); this.onForwardingHistoryFetch();
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsub[0])) .pipe(takeUntil(this.unsub[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromRTLReducer.State) => {
@ -64,6 +64,10 @@ export class ForwardingHistoryComponent implements OnInit, OnDestroy {
if (undefined !== rtlStore.forwardingHistory && undefined !== rtlStore.forwardingHistory.forwarding_events) { if (undefined !== rtlStore.forwardingHistory && undefined !== rtlStore.forwardingHistory.forwarding_events) {
this.lastOffsetIndex = rtlStore.forwardingHistory.last_offset_index; this.lastOffsetIndex = rtlStore.forwardingHistory.last_offset_index;
this.loadForwardingEventsTable(rtlStore.forwardingHistory.forwarding_events); this.loadForwardingEventsTable(rtlStore.forwardingHistory.forwarding_events);
} else {
// To reset table after other Forwarding history calls
this.lastOffsetIndex = 0;
this.loadForwardingEventsTable([]);
} }
if (this.flgLoading[0] !== 'error') { if (this.flgLoading[0] !== 'error') {
this.flgLoading[0] = (undefined !== rtlStore.forwardingHistory) ? false : true; this.flgLoading[0] = (undefined !== rtlStore.forwardingHistory) ? false : true;

@ -253,6 +253,8 @@ export function RTLRootReducer(state = initialState, action: RTLActions.RTLActio
} }
} }
}); });
} else {
action.payload = {};
} }
return { return {
...state, ...state,

Loading…
Cancel
Save