Incomplete lazy load 2

Incomplete lazy load 2
pull/209/head
Shahana Farooqui 5 years ago
parent befd1d78f6
commit 82ffa315b7

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -9,5 +9,5 @@
<link rel="stylesheet" href="styles.95c3afc83be2d91ee834.css"></head> <link rel="stylesheet" href="styles.95c3afc83be2d91ee834.css"></head>
<body> <body>
<rtl-app></rtl-app> <rtl-app></rtl-app>
<script src="runtime-es2015.6c92075aefa095411d25.js" type="module"></script><script src="polyfills-es2015.af35579f5b57e97fcdea.js" type="module"></script><script src="runtime-es5.18bd9dad956fbe3e232b.js" nomodule></script><script src="polyfills-es5.64372fcf007b6e0e7247.js" nomodule></script><script src="main-es2015.ce6838ac20fd6a1ca513.js" type="module"></script><script src="main-es5.8b3dd6dbebaa2e71a11e.js" nomodule></script></body> <script src="runtime-es2015.3823fce60e023395905e.js" type="module"></script><script src="polyfills-es2015.af35579f5b57e97fcdea.js" type="module"></script><script src="runtime-es5.2953e9422ec209420d0e.js" nomodule></script><script src="polyfills-es5.64372fcf007b6e0e7247.js" nomodule></script><script src="main-es2015.cb85c9adb81ec81ff7f4.js" type="module"></script><script src="main-es5.381f902d2d21a950120d.js" nomodule></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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
!function(e){function r(r){for(var n,i,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)o[i=a[p]]&&s.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++)0!==o[t[a]]&&(n=!1);n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={0:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+""+({}[e]||e)+"-es2015."+{1:"3e412c623e89cdf24dfb",5:"dfda4684cef2bd775937",6:"651bccdf8f4ccb7e6e16"}[e]+".js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout(function(){u({type:"timeout",target:a})},12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,(function(r){return e[r]}).bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var l=c;t()}([]);

@ -1 +0,0 @@
!function(e){function r(r){for(var n,a,i=r[0],c=r[1],f=r[2],p=0,s=[];p<i.length;p++)o[a=i[p]]&&s.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={0:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({}[e]||e)+"-es2015."+{1:"6aacfc3b356893189a11",5:"728790da8d674f1a9a03",6:"12f89c6eac1f84929add"}[e]+".js"}(e);var c=new Error;u=function(r){i.onerror=i.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout(function(){u({type:"timeout",target:i})},12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,(function(r){return e[r]}).bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var f=0;f<i.length;f++)r(i[f]);var l=c;t()}([]);

@ -1 +1 @@
!function(e){function r(r){for(var n,i,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)o[i=a[p]]&&s.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++)0!==o[t[a]]&&(n=!1);n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={0:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+""+({}[e]||e)+"-es5."+{1:"988ddf44a4866c3ff558",4:"2ce4f749146b640b4203",5:"dc29e5cf514a69f8162d"}[e]+".js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout(function(){u({type:"timeout",target:a})},12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,(function(r){return e[r]}).bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var l=c;t()}([]); !function(e){function r(r){for(var n,i,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)o[i=a[p]]&&s.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++)0!==o[t[a]]&&(n=!1);n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={0:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+""+({}[e]||e)+"-es5."+{1:"572105fd62f1a1fb6122",4:"224c734b259c83972052",5:"9e7241a89bb15935113e"}[e]+".js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout(function(){u({type:"timeout",target:a})},12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,(function(r){return e[r]}).bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var l=c;t()}([]);

@ -11,7 +11,7 @@ import { LoggerService } from './shared/services/logger.service';
import { RTLConfiguration, Settings, Node, SelNodeInfo } from './shared/models/RTLconfig'; import { RTLConfiguration, Settings, Node, SelNodeInfo } from './shared/models/RTLconfig';
import * as RTLActions from './store/rtl.actions'; import * as RTLActions from './store/rtl.actions';
import * as fromRTLReducer from './store/rtl.reducers'; import * as fromApp from './store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-app', selector: 'rtl-app',
@ -31,7 +31,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
public smallScreen = false; public smallScreen = false;
unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()]; unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private actions$: Actions, private userIdle: UserIdleService, private router: Router) {} constructor(private logger: LoggerService, private store: Store<fromApp.AppState>, private actions$: Actions, private userIdle: UserIdleService, private router: Router) {}
ngOnInit() { ngOnInit() {
this.store.dispatch(new RTLActions.FetchRTLConfig()); this.store.dispatch(new RTLActions.FetchRTLConfig());
@ -39,7 +39,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe(rtlStore => { .subscribe(rtlStore => {
this.selNodeInfo = rtlStore.selNodeInfo; // this.selNodeInfo = rtlStore.selNodeInfo;
this.selNode = rtlStore.selNode; this.selNode = rtlStore.selNode;
this.settings = this.selNode.settings; this.settings = this.selNode.settings;
this.appConfig = rtlStore.appConfig; this.appConfig = rtlStore.appConfig;

@ -21,8 +21,6 @@ import { environment } from '../environments/environment';
import { routing } from './app.routing'; import { routing } from './app.routing';
import { SharedModule } from './shared/shared.module'; import { SharedModule } from './shared/shared.module';
import { ThemeOverlay } from './shared/theme/overlay-container/theme-overlay'; import { ThemeOverlay } from './shared/theme/overlay-container/theme-overlay';
import { RTLRootReducer } from './store/rtl.reducers';
import { RTLEffects } from './store/rtl.effects';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { CommonService } from './shared/services/common.service'; import { CommonService } from './shared/services/common.service';
@ -30,6 +28,11 @@ import { LoggerService, ConsoleLoggerService } from './shared/services/logger.se
import { AuthGuard, LNDUnlockedGuard } from './shared/services/auth.guard'; import { AuthGuard, LNDUnlockedGuard } from './shared/services/auth.guard';
import { AuthInterceptor } from './shared/services/auth.interceptor'; import { AuthInterceptor } from './shared/services/auth.interceptor';
import * as fromApp from './store/rtl.reducers';
import { RTLEffects } from './store/rtl.effects';
import { LNDEffects } from './lnd/store/lnd.effects';
import { CLEffects } from './c-lightning/store/cl.effects';
@NgModule({ @NgModule({
imports: [ imports: [
BrowserModule, BrowserModule,
@ -39,8 +42,8 @@ import { AuthInterceptor } from './shared/services/auth.interceptor';
SharedModule, SharedModule,
routing, routing,
UserIdleModule.forRoot({idle: 60 * 60, timeout: 1, ping: null}), UserIdleModule.forRoot({idle: 60 * 60, timeout: 1, ping: null}),
StoreModule.forRoot({rtlRoot: RTLRootReducer}), StoreModule.forRoot(fromApp.appReducer),
EffectsModule.forRoot([RTLEffects]), EffectsModule.forRoot([RTLEffects, LNDEffects, CLEffects]),
!environment.production ? StoreDevtoolsModule.instrument() : [] !environment.production ? StoreDevtoolsModule.instrument() : []
], ],
declarations: [ declarations: [

@ -4,19 +4,19 @@ import { ModuleWithProviders } from '@angular/core';
import { ServerConfigComponent } from './shared/components/server-config/server-config.component'; import { ServerConfigComponent } from './shared/components/server-config/server-config.component';
import { HelpComponent } from './shared/components/help/help.component'; import { HelpComponent } from './shared/components/help/help.component';
import { SigninComponent } from './shared/components/signin/signin.component'; import { SigninComponent } from './shared/components/signin/signin.component';
import { NotFoundComponent } from './shared/components/not-found/not-found.component';
import { SsoFailedComponent } from './shared/components/sso-failed/sso-failed.component'; import { SsoFailedComponent } from './shared/components/sso-failed/sso-failed.component';
import { NotFoundComponent } from './shared/components/not-found/not-found.component';
import { AuthGuard } from './shared/services/auth.guard'; import { AuthGuard } from './shared/services/auth.guard';
export const routes: Routes = [ export const routes: Routes = [
{ path: '', redirectTo: '/lnd', pathMatch: 'full' }, { path: '', redirectTo: '/cl', pathMatch: 'full' },
{ path: 'lnd', loadChildren: () => import('./lnd/lnd.module').then(childModule => childModule.LndModule)}, { path: 'lnd', loadChildren: () => import('./lnd/lnd.module').then(childModule => childModule.LndModule)},
{ path: 'cl', loadChildren: () => import('./c-lightning/cl.module').then(childModule => childModule.ClModule)}, { path: 'cl', loadChildren: () => import('./c-lightning/cl.module').then(childModule => childModule.ClModule)},
{ path: 'sconfig', component: ServerConfigComponent, canActivate: [AuthGuard] }, { path: 'sconfig', component: ServerConfigComponent, canActivate: [AuthGuard] },
{ path: 'login', component: SigninComponent }, { path: 'login', component: SigninComponent },
{ path: 'help', component: HelpComponent }, { path: 'help', component: HelpComponent },
{ path: 'ssoerror', component: SsoFailedComponent }, { path: 'ssoerror', component: SsoFailedComponent },
{ path: '**', component: NotFoundComponent } { path: '**', component: NotFoundComponent }
]; ];
export const routing: ModuleWithProviders = RouterModule.forRoot(routes); export const routing: ModuleWithProviders = RouterModule.forRoot(routes);

@ -7,7 +7,7 @@ import { Actions } from '@ngrx/effects';
import * as CLActions from './store/cl.actions'; import * as CLActions from './store/cl.actions';
import * as RTLActions from '../store/rtl.actions'; import * as RTLActions from '../store/rtl.actions';
import * as fromRTLReducer from '../store/rtl.reducers'; import * as fromApp from '../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-cl-root-app', selector: 'rtl-cl-root-app',
@ -17,11 +17,13 @@ import * as fromRTLReducer from '../store/rtl.reducers';
export class ClRootComponent implements OnInit, OnDestroy { export class ClRootComponent implements OnInit, OnDestroy {
unsubs: Array<Subject<void>> = [new Subject(), new Subject()]; unsubs: Array<Subject<void>> = [new Subject(), new Subject()];
constructor(private store: Store<fromRTLReducer.State>, private actions$: Actions, private router: Router, private activatedRoute: ActivatedRoute) {} constructor(private store: Store<fromApp.AppState>, private actions$: Actions, private router: Router, private activatedRoute: ActivatedRoute) {}
ngOnInit() { ngOnInit() {
console.warn('CL ROOT'); console.warn('CL ROOT');
this.router.navigate(['./home'], {relativeTo: this.activatedRoute}); console.warn(this.activatedRoute.url);
// this.router.navigate(['./home'], {relativeTo: this.activatedRoute});
this.store.dispatch(new CLActions.FetchCLInfo());
this.actions$.pipe(takeUntil(this.unsubs[0]), filter((action) => action.type === RTLActions.INIT_APP_DATA)) this.actions$.pipe(takeUntil(this.unsubs[0]), filter((action) => action.type === RTLActions.INIT_APP_DATA))
.subscribe((actionPayload: RTLActions.InitAppData) => { .subscribe((actionPayload: RTLActions.InitAppData) => {
this.store.dispatch(new CLActions.FetchCLInfo()); this.store.dispatch(new CLActions.FetchCLInfo());

@ -1,14 +1,10 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { NgxChartsModule } from '@swimlane/ngx-charts'; import { NgxChartsModule } from '@swimlane/ngx-charts';
import { StoreModule } from '@ngrx/store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { EffectsModule } from '@ngrx/effects';
import { environment } from '../../environments/environment'; import { environment } from '../../environments/environment';
import { SharedModule } from '../shared/shared.module'; import { SharedModule } from '../shared/shared.module';
import { CLReducer } from './store/cl.reducers';
import { CLEffects } from './store/cl.effects';
import { clRouting } from './cl.routing'; import { clRouting } from './cl.routing';
import { ClRootComponent } from './cl-root.component'; import { ClRootComponent } from './cl-root.component';
@ -20,8 +16,6 @@ import { HomeComponent } from './home/home.component';
SharedModule, SharedModule,
clRouting, clRouting,
NgxChartsModule, NgxChartsModule,
EffectsModule.forFeature([CLEffects]),
StoreModule.forFeature('cl', CLReducer),
!environment.production ? StoreDevtoolsModule.instrument() : [] !environment.production ? StoreDevtoolsModule.instrument() : []
], ],
declarations: [ declarations: [

@ -2,14 +2,18 @@ import { Routes, RouterModule } from '@angular/router';
import { ModuleWithProviders } from '@angular/core'; import { ModuleWithProviders } from '@angular/core';
import { AuthGuard } from '../shared/services/auth.guard'; import { AuthGuard } from '../shared/services/auth.guard';
import { NotFoundComponent } from '../shared/components/not-found/not-found.component';
import { ClRootComponent } from './cl-root.component'; import { ClRootComponent } from './cl-root.component';
import { HomeComponent } from './home/home.component'; import { HomeComponent } from './home/home.component';
export const clRoutes: Routes = [ export const clRoutes: Routes = [
{ path: '', redirectTo: '.', pathMatch: 'full', canActivate: [AuthGuard]}, { path: '', component: ClRootComponent,
{ path: '.', component: ClRootComponent, canActivate: [AuthGuard] }, children: [
{ path: './home', component: HomeComponent, canActivate: [AuthGuard] } { path: 'home', component: HomeComponent, canActivate: [AuthGuard] },
{ path: '**', component: NotFoundComponent }
]
}
]; ];
export const clRouting: ModuleWithProviders = RouterModule.forChild(clRoutes); export const clRouting: ModuleWithProviders = RouterModule.forChild(clRoutes);

@ -6,7 +6,7 @@ import { Store } from '@ngrx/store';
import { LoggerService } from '../../shared/services/logger.service'; import { LoggerService } from '../../shared/services/logger.service';
import { GetInfo } from '../../shared/models/clModels'; import { GetInfo } from '../../shared/models/clModels';
import * as fromCLReducer from '../store/cl.reducers'; import * as fromApp from '../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-home', selector: 'rtl-home',
@ -17,11 +17,11 @@ export class HomeComponent implements OnInit, OnDestroy {
public information: GetInfo = {}; public information: GetInfo = {};
private unsubs: Array<Subject<void>> = [new Subject(), new Subject()]; private unsubs: Array<Subject<void>> = [new Subject(), new Subject()];
constructor(private logger: LoggerService, private clStore: Store<fromCLReducer.CLState>) {} constructor(private logger: LoggerService, private store: Store<fromApp.AppState>) {}
ngOnInit() { ngOnInit() {
console.warn('CL HOME'); console.warn('CL HOME');
this.clStore.select('cl') this.store.select('cl')
.pipe(takeUntil(this.unsubs[1])) .pipe(takeUntil(this.unsubs[1]))
.subscribe(clStore => { .subscribe(clStore => {
this.information = clStore.information; this.information = clStore.information;

@ -13,9 +13,8 @@ import { LoggerService } from '../../shared/services/logger.service';
import { GetInfo } from '../../shared/models/clModels'; import { GetInfo } from '../../shared/models/clModels';
import * as RTLActions from '../../store/rtl.actions'; import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers';
import * as CLActions from './cl.actions'; import * as CLActions from './cl.actions';
import * as fromCLReducer from './cl.reducers'; import * as fromApp from '../../store/rtl.reducers';
@Injectable() @Injectable()
export class CLEffects implements OnDestroy { export class CLEffects implements OnDestroy {
@ -25,7 +24,7 @@ export class CLEffects implements OnDestroy {
constructor( constructor(
private actions$: Actions, private actions$: Actions,
private httpClient: HttpClient, private httpClient: HttpClient,
private store: Store<fromCLReducer.CLState>, private store: Store<fromApp.AppState>,
private logger: LoggerService, private logger: LoggerService,
public dialog: MatDialog, public dialog: MatDialog,
private router: Router) { } private router: Router) { }
@ -34,21 +33,21 @@ export class CLEffects implements OnDestroy {
infoFetch = this.actions$.pipe( infoFetch = this.actions$.pipe(
ofType(CLActions.FETCH_CL_INFO), ofType(CLActions.FETCH_CL_INFO),
withLatestFrom(this.store.select('rtlRoot')), withLatestFrom(this.store.select('rtlRoot')),
mergeMap(([action, store]: [CLActions.FetchCLInfo, fromRTLReducer.State]) => { mergeMap(([action, store]: [CLActions.FetchCLInfo, fromApp.RootState]) => {
this.store.dispatch(new RTLActions.ClearEffectError('FetchInfo')); this.store.dispatch(new RTLActions.ClearEffectError('FetchInfo'));
return this.httpClient.get<GetInfo>(environment.GETINFO_API) return this.httpClient.get<GetInfo>(environment.GETINFO_API)
.pipe( .pipe(
map((info) => { map((info) => {
this.logger.info(info); this.logger.info(info);
if (undefined === info.identity_pubkey) { if (undefined === info.identity_pubkey) {
this.store.dispatch(new RTLActions.SetSelNodeInfo({})); // this.store.dispatch(new RTLActions.SetSelNodeInfo({}));
sessionStorage.removeItem('clUnlocked'); sessionStorage.removeItem('clUnlocked');
return { return {
type: CLActions.SET_CL_INFO, type: CLActions.SET_CL_INFO,
payload: {} payload: {}
}; };
} else { } else {
this.store.dispatch(new RTLActions.SetSelNodeInfo(info)); // this.store.dispatch(new RTLActions.SetSelNodeInfo(info));
sessionStorage.setItem('clUnlocked', 'true'); sessionStorage.setItem('clUnlocked', 'true');
return { return {
type: CLActions.SET_CL_INFO, type: CLActions.SET_CL_INFO,

@ -1,10 +1,5 @@
import * as CLActions from './cl.actions'; import * as CLActions from './cl.actions';
import { GetInfo, GetInfoChain } from '../../shared/models/clModels'; import { GetInfo, GetInfoChain } from '../../shared/models/clModels';
import * as fromApp from '../../store/rtl.reducers';
export interface FeatureState extends fromApp.State {
cl: CLState;
}
export interface CLState { export interface CLState {
information: GetInfo; information: GetInfo;

@ -11,9 +11,8 @@ import { Channel } from '../../../shared/models/lndModels';
import { LoggerService } from '../../../shared/services/logger.service'; import { LoggerService } from '../../../shared/services/logger.service';
import * as LNDActions from '../../store/lnd.actions'; import * as LNDActions from '../../store/lnd.actions';
import * as fromLNDReducer from '../../store/lnd.reducers';
import * as RTLActions from '../../../store/rtl.actions'; import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers'; import * as fromApp from '../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-channel-backup', selector: 'rtl-channel-backup',
@ -30,11 +29,10 @@ export class ChannelBackupComponent implements OnInit, OnDestroy {
public flgSticky = false; public flgSticky = false;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, constructor(private logger: LoggerService, private store: Store<fromApp.AppState>, private actions$: Actions) {}
private lndStore: Store<fromLNDReducer.LNDState>, private actions$: Actions) {}
ngOnInit() { ngOnInit() {
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unSubs[4])) .pipe(takeUntil(this.unSubs[4]))
.subscribe(lndStore => { .subscribe(lndStore => {
this.channels = new MatTableDataSource([]); this.channels = new MatTableDataSource([]);
@ -60,7 +58,7 @@ export class ChannelBackupComponent implements OnInit, OnDestroy {
}); });
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unSubs[0])) .pipe(takeUntil(this.unSubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
this.selNode = rtlStore.selNode; this.selNode = rtlStore.selNode;
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'Fetchchannels') { if (effectsErr.action === 'Fetchchannels') {

@ -9,9 +9,8 @@ import { ClosedChannel } from '../../../shared/models/lndModels';
import { LoggerService } from '../../../shared/services/logger.service'; import { LoggerService } from '../../../shared/services/logger.service';
import * as LNDActions from '../../store/lnd.actions'; import * as LNDActions from '../../store/lnd.actions';
import * as fromLNDReducer from '../../store/lnd.reducers';
import * as RTLActions from '../../../store/rtl.actions'; import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers'; import * as fromApp from '../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-channel-closed', selector: 'rtl-channel-closed',
@ -27,7 +26,7 @@ export class ChannelClosedComponent implements OnInit, OnDestroy {
public flgSticky = false; public flgSticky = false;
private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()]; private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private lndStore: Store<fromLNDReducer.LNDState>, private actions$: Actions) { constructor(private logger: LoggerService, private store: Store<fromApp.AppState>, private actions$: Actions) {
switch (true) { switch (true) {
case (window.innerWidth <= 415): case (window.innerWidth <= 415):
this.displayedColumns = ['close_type', 'chan_id', 'settled_balance']; this.displayedColumns = ['close_type', 'chan_id', 'settled_balance'];
@ -56,7 +55,7 @@ export class ChannelClosedComponent implements OnInit, OnDestroy {
this.actions$.pipe(takeUntil(this.unsubs[2]), filter((action) => action.type === RTLActions.RESET_STORE)).subscribe((resetStore: RTLActions.ResetStore) => { this.actions$.pipe(takeUntil(this.unsubs[2]), filter((action) => action.type === RTLActions.RESET_STORE)).subscribe((resetStore: RTLActions.ResetStore) => {
this.store.dispatch(new LNDActions.FetchChannels({routeParam: 'closed'})); this.store.dispatch(new LNDActions.FetchChannels({routeParam: 'closed'}));
}); });
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unsubs[3])) .pipe(takeUntil(this.unsubs[3]))
.subscribe(lndStore => { .subscribe(lndStore => {
if (undefined !== lndStore.closedChannels) { if (undefined !== lndStore.closedChannels) {
@ -69,7 +68,7 @@ export class ChannelClosedComponent implements OnInit, OnDestroy {
}); });
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'FetchChannels/closed') { if (effectsErr.action === 'FetchChannels/closed') {
this.flgLoading[0] = 'error'; this.flgLoading[0] = 'error';

@ -1,21 +1,19 @@
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { Router, NavigationStart, ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { Subject, Observable } from 'rxjs'; import { Subject } from 'rxjs';
import { takeUntil, filter, map, subscribeOn } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import { MatTableDataSource, MatSort } from '@angular/material'; import { MatTableDataSource, MatSort } from '@angular/material';
import { Channel, Peer, GetInfo } from '../../../shared/models/lndModels'; import { Channel, Peer, GetInfo } from '../../../shared/models/lndModels';
import { LoggerService } from '../../../shared/services/logger.service'; import { LoggerService } from '../../../shared/services/logger.service';
import { LNDEffects } from '../../store/lnd.effects'; import { LNDEffects } from '../../store/lnd.effects';
import * as LNDActions from '../../store/lnd.actions';
import * as fromLNDReducer from '../../store/lnd.reducers';
import { RTLEffects } from '../../../store/rtl.effects'; import { RTLEffects } from '../../../store/rtl.effects';
import * as LNDActions from '../../store/lnd.actions';
import * as RTLActions from '../../../store/rtl.actions'; import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers'; import * as fromApp from '../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-channel-manage', selector: 'rtl-channel-manage',
@ -45,8 +43,8 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
public redirectedWithPeer = false; public redirectedWithPeer = false;
private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), 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<fromApp.AppState>, private rtlEffects: RTLEffects,
private lndEffects: LNDEffects, private lndStore: Store<fromLNDReducer.LNDState>, private activatedRoute: ActivatedRoute) { private lndEffects: LNDEffects, private activatedRoute: ActivatedRoute) {
switch (true) { switch (true) {
case (window.innerWidth <= 415): case (window.innerWidth <= 415):
this.displayedColumns = ['close', 'update', 'active', 'chan_id', 'remote_alias']; this.displayedColumns = ['close', 'update', 'active', 'chan_id', 'remote_alias'];
@ -71,7 +69,7 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unsubs[5])) .pipe(takeUntil(this.unsubs[5]))
.subscribe(lndStore => { .subscribe(lndStore => {
this.information = lndStore.information; this.information = lndStore.information;
@ -94,7 +92,7 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'FetchChannels/all') { if (effectsErr.action === 'FetchChannels/all') {
this.flgLoading[0] = 'error'; this.flgLoading[0] = 'error';

@ -8,9 +8,8 @@ import { Channel, GetInfo, PendingChannels } from '../../../shared/models/lndMod
import { Node } from '../../../shared/models/RTLconfig'; import { Node } from '../../../shared/models/RTLconfig';
import { LoggerService } from '../../../shared/services/logger.service'; import { LoggerService } from '../../../shared/services/logger.service';
import * as fromLNDReducer from '../../store/lnd.reducers';
import * as RTLActions from '../../../store/rtl.actions'; import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers'; import * as fromApp from '../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-channel-pending', selector: 'rtl-channel-pending',
@ -50,7 +49,7 @@ export class ChannelPendingComponent implements OnInit, OnDestroy {
public flgLoading: Array<Boolean | 'error'> = [true]; public flgLoading: Array<Boolean | 'error'> = [true];
private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()]; private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private lndStore: Store<fromLNDReducer.LNDState>) { constructor(private logger: LoggerService, private store: Store<fromApp.AppState>) {
switch (true) { switch (true) {
case (window.innerWidth <= 415): case (window.innerWidth <= 415):
this.displayedClosingColumns = ['remote_node_pub', 'local_balance', 'remote_balance']; this.displayedClosingColumns = ['remote_node_pub', 'local_balance', 'remote_balance'];
@ -96,7 +95,7 @@ export class ChannelPendingComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unsubs[2])) .pipe(takeUntil(this.unsubs[2]))
.subscribe(lndStore => { .subscribe(lndStore => {
this.information = lndStore.information; this.information = lndStore.information;
@ -124,7 +123,7 @@ export class ChannelPendingComponent implements OnInit, OnDestroy {
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'FetchChannels/pending') { if (effectsErr.action === 'FetchChannels/pending') {
this.flgLoading[0] = 'error'; this.flgLoading[0] = 'error';

@ -7,8 +7,7 @@ import { LoggerService } from '../../shared/services/logger.service';
import { GetInfo, NetworkInfo, Fees, Peer } from '../../shared/models/lndModels'; import { GetInfo, NetworkInfo, Fees, Peer } from '../../shared/models/lndModels';
import { Node } from '../../shared/models/RTLconfig'; import { Node } from '../../shared/models/RTLconfig';
import * as fromLNDReducer from '../store/lnd.reducers'; import * as fromApp from '../../store/rtl.reducers';
import * as fromRTLReducer from '../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-home', selector: 'rtl-home',
@ -42,7 +41,7 @@ export class HomeComponent implements OnInit, OnDestroy {
yAxisLabel = 'Balance'; yAxisLabel = 'Balance';
colorScheme = {domain: ['#FFFFFF']}; colorScheme = {domain: ['#FFFFFF']};
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private lndStore: Store<fromLNDReducer.LNDState>) { constructor(private logger: LoggerService, private store: Store<fromApp.AppState>) {
switch (true) { switch (true) {
case (window.innerWidth <= 730): case (window.innerWidth <= 730):
this.view = [250, 352]; this.view = [250, 352];
@ -65,7 +64,7 @@ export class HomeComponent implements OnInit, OnDestroy {
ngOnInit() { ngOnInit() {
this.flgTotalCalculated = false; this.flgTotalCalculated = false;
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unsubs[1])) .pipe(takeUntil(this.unsubs[1]))
.subscribe(lndStore => { .subscribe(lndStore => {
this.information = lndStore.information; this.information = lndStore.information;
@ -109,7 +108,7 @@ export class HomeComponent implements OnInit, OnDestroy {
}); });
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'FetchInfo') { if (effectsErr.action === 'FetchInfo') {
this.flgLoading[0] = 'error'; this.flgLoading[0] = 'error';

@ -12,9 +12,8 @@ import { LoggerService } from '../../shared/services/logger.service';
import { newlyAddedRowAnimation } from '../../shared/animation/row-animation'; import { newlyAddedRowAnimation } from '../../shared/animation/row-animation';
import * as LNDActions from '../store/lnd.actions'; import * as LNDActions from '../store/lnd.actions';
import * as fromLNDReducer from '../store/lnd.reducers';
import * as RTLActions from '../../store/rtl.actions'; import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers'; import * as fromApp from '../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-invoices', selector: 'rtl-invoices',
@ -45,7 +44,7 @@ export class InvoicesComponent implements OnInit, OnDestroy {
private lastOffset = -1; private lastOffset = -1;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private lndStore: Store<fromLNDReducer.LNDState>) { constructor(private logger: LoggerService, private store: Store<fromApp.AppState>) {
switch (true) { switch (true) {
case (window.innerWidth <= 415): case (window.innerWidth <= 415):
this.displayedColumns = ['settled', 'creation_date', 'memo', 'value']; this.displayedColumns = ['settled', 'creation_date', 'memo', 'value'];
@ -68,7 +67,7 @@ export class InvoicesComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unSubs[5])) .pipe(takeUntil(this.unSubs[5]))
.subscribe(lndStore => { .subscribe(lndStore => {
this.information = lndStore ? lndStore.information : {}; this.information = lndStore ? lndStore.information : {};
@ -84,7 +83,7 @@ export class InvoicesComponent implements OnInit, OnDestroy {
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unSubs[0])) .pipe(takeUntil(this.unSubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'FetchInvoices') { if (effectsErr.action === 'FetchInvoices') {
this.flgLoading[0] = 'error'; this.flgLoading[0] = 'error';

@ -3,10 +3,10 @@ import { Router, ActivatedRoute } from '@angular/router';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators'; import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import * as fromLNDReducer from './store/lnd.reducers';
import * as LNDActions from './store/lnd.actions'; import * as LNDActions from './store/lnd.actions';
import * as fromRTLReducer from '../store/rtl.reducers'; import * as fromApp from '../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-lnd-root-app', selector: 'rtl-lnd-root-app',
@ -14,21 +14,30 @@ import * as fromRTLReducer from '../store/rtl.reducers';
styleUrls: ['./lnd-root.component.scss'] styleUrls: ['./lnd-root.component.scss']
}) })
export class LndRootComponent implements OnInit, OnDestroy { export class LndRootComponent implements OnInit, OnDestroy {
unsubs: Array<Subject<void>> = [new Subject(), new Subject()]; unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
constructor(private store: Store<fromRTLReducer.State>, private lndStore: Store<fromLNDReducer.LNDState>, private router: Router, private activatedRoute: ActivatedRoute) {} constructor(private store: Store<fromApp.AppState>, private router: Router, private activatedRoute: ActivatedRoute, private actions$: Actions) {}
ngOnInit() { ngOnInit() {
console.warn('LND ROOT'); console.warn('LND ROOT');
// this.router.navigate(['./home'], {relativeTo: this.activatedRoute});
this.store.dispatch(new LNDActions.FetchInfo()); this.store.dispatch(new LNDActions.FetchInfo());
this.router.navigate(['./home'], {relativeTo: this.activatedRoute}); this.store.select('lnd')
this.lndStore.select('lnd')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe(lndStore => { .subscribe(lndStore => {
console.warn(lndStore);
if (undefined !== lndStore.information.identity_pubkey) { if (undefined !== lndStore.information.identity_pubkey) {
this.initializeRemainingData(); this.initializeRemainingData();
} }
}); });
this.store.dispatch(new LNDActions.FetchInfo());
this.actions$.pipe(takeUntil(this.unsubs[2]), filter((action) => action.type === LNDActions.SET_INFO))
.subscribe((infoData: LNDActions.SetInfo) => {
console.warn(infoData);
if (undefined !== infoData.payload.identity_pubkey) {
this.initializeRemainingData();
}
});
} }
initializeRemainingData() { initializeRemainingData() {

@ -1,14 +1,10 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { NgxChartsModule } from '@swimlane/ngx-charts'; import { NgxChartsModule } from '@swimlane/ngx-charts';
import { StoreModule } from '@ngrx/store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { EffectsModule } from '@ngrx/effects';
import { environment } from '../../environments/environment'; import { environment } from '../../environments/environment';
import { SharedModule } from '../shared/shared.module'; import { SharedModule } from '../shared/shared.module';
import { LNDReducer } from './store/lnd.reducers';
import { LNDEffects } from './store/lnd.effects';
import { lndRouting } from './lnd.routing'; import { lndRouting } from './lnd.routing';
import { LndRootComponent } from './lnd-root.component'; import { LndRootComponent } from './lnd-root.component';
@ -36,8 +32,6 @@ import { QueryRoutesComponent } from './payments/query-routes/query-routes.compo
SharedModule, SharedModule,
lndRouting, lndRouting,
NgxChartsModule, NgxChartsModule,
EffectsModule.forFeature([LNDEffects]),
StoreModule.forFeature('lnd', LNDReducer),
!environment.production ? StoreDevtoolsModule.instrument() : [] !environment.production ? StoreDevtoolsModule.instrument() : []
], ],
declarations: [ declarations: [

@ -2,6 +2,7 @@ import { Routes, RouterModule } from '@angular/router';
import { ModuleWithProviders } from '@angular/core'; import { ModuleWithProviders } from '@angular/core';
import { AuthGuard, LNDUnlockedGuard } from '../shared/services/auth.guard'; import { AuthGuard, LNDUnlockedGuard } from '../shared/services/auth.guard';
import { NotFoundComponent } from '../shared/components/not-found/not-found.component';
import { LndRootComponent } from './lnd-root.component'; import { LndRootComponent } from './lnd-root.component';
import { HomeComponent } from './home/home.component'; import { HomeComponent } from './home/home.component';
@ -21,23 +22,26 @@ import { RoutingPeersComponent } from './routing-peers/routing-peers.component';
import { ChannelBackupComponent } from './channels/channel-backup/channel-backup.component'; import { ChannelBackupComponent } from './channels/channel-backup/channel-backup.component';
export const lndRoutes: Routes = [ export const lndRoutes: Routes = [
{ path: '', redirectTo: '.', pathMatch: 'full', canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: '', component: LndRootComponent,
{ path: '.', component: LndRootComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, children: [
{ path: './unlocklnd', component: UnlockLNDComponent, canActivate: [AuthGuard] }, { path: 'home', component: HomeComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './home', component: HomeComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'unlocklnd', component: UnlockLNDComponent, canActivate: [AuthGuard] },
{ path: './peers', component: PeersComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'peers', component: PeersComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './chnlclosed', component: ChannelClosedComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'chnlclosed', component: ChannelClosedComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './chnlmanage', component: ChannelManageComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'chnlmanage', component: ChannelManageComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './chnlpending', component: ChannelPendingComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'chnlpending', component: ChannelPendingComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './chnlbackup', component: ChannelBackupComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'chnlbackup', component: ChannelBackupComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './transsendreceive', component: SendReceiveTransComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'transsendreceive', component: SendReceiveTransComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './translist', component: ListTransactionsComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'translist', component: ListTransactionsComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './paymentsend', component: PaymentsComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'paymentsend', component: PaymentsComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './queryroutes', component: QueryRoutesComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'queryroutes', component: QueryRoutesComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './invoices', component: InvoicesComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'invoices', component: InvoicesComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './switch', component: ForwardingHistoryComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'switch', component: ForwardingHistoryComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './routingpeers', component: RoutingPeersComponent, canActivate: [AuthGuard, LNDUnlockedGuard] }, { path: 'routingpeers', component: RoutingPeersComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: './lookups', component: LookupsComponent, canActivate: [AuthGuard, LNDUnlockedGuard] } { path: 'lookups', component: LookupsComponent, canActivate: [AuthGuard, LNDUnlockedGuard] },
{ path: '**', component: NotFoundComponent }
]
}
]; ];
export const lndRouting: ModuleWithProviders = RouterModule.forChild(lndRoutes); export const lndRouting: ModuleWithProviders = RouterModule.forChild(lndRoutes);

@ -6,10 +6,9 @@ import { Actions } from '@ngrx/effects';
import { LoggerService } from '../../shared/services/logger.service'; import { LoggerService } from '../../shared/services/logger.service';
import { LNDEffects } from '../store/lnd.effects';
import * as LNDActions from '../store/lnd.actions'; import * as LNDActions from '../store/lnd.actions';
import * as RTLActions from '../../store/rtl.actions'; import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers'; import * as fromApp from '../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-lookups', selector: 'rtl-lookups',
@ -30,7 +29,7 @@ export class LookupsComponent implements OnInit, OnDestroy {
public flgLoading: Array<Boolean | 'error'> = [true]; public flgLoading: Array<Boolean | 'error'> = [true];
private unSubs: Array<Subject<void>> = [new Subject()]; private unSubs: Array<Subject<void>> = [new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private actions$: Actions) {} constructor(private logger: LoggerService, private store: Store<fromApp.AppState>, private actions$: Actions) {}
ngOnInit() { ngOnInit() {
this.actions$ this.actions$

@ -9,11 +9,10 @@ import { MatTableDataSource, MatSort } from '@angular/material';
import { Hop } from '../../../shared/models/lndModels'; import { Hop } from '../../../shared/models/lndModels';
import { LoggerService } from '../../../shared/services/logger.service'; import { LoggerService } from '../../../shared/services/logger.service';
import { LNDEffects } from '../../store/lnd.effects'; import { LNDEffects } from '../../store/lnd.effects';
import * as LNDActions from '../../store/lnd.actions'; import * as LNDActions from '../../store/lnd.actions';
import { RTLEffects } from '../../../store/rtl.effects';
import * as RTLActions from '../../../store/rtl.actions'; import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers'; import * as fromApp from '../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-query-routes', selector: 'rtl-query-routes',
@ -30,7 +29,7 @@ export class QueryRoutesComponent implements OnInit, OnDestroy {
public flgLoading: Array<Boolean | 'error'> = [false]; // 0: peers public flgLoading: Array<Boolean | 'error'> = [false]; // 0: peers
private unSubs: Array<Subject<void>> = [new Subject(), new Subject()]; private unSubs: Array<Subject<void>> = [new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private lndEffects: LNDEffects, private actions$: Actions) { constructor(private logger: LoggerService, private store: Store<fromApp.AppState>, private lndEffects: LNDEffects, private actions$: Actions) {
switch (true) { switch (true) {
case (window.innerWidth <= 415): case (window.innerWidth <= 415):
this.displayedColumns = ['hop_sequence', 'pubkey_alias', 'fee_msat']; this.displayedColumns = ['hop_sequence', 'pubkey_alias', 'fee_msat'];
@ -55,7 +54,7 @@ export class QueryRoutesComponent implements OnInit, OnDestroy {
ngOnInit() { ngOnInit() {
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unSubs[0])) .pipe(takeUntil(this.unSubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
this.logger.info(rtlStore); this.logger.info(rtlStore);
}); });
this.lndEffects.setQueryRoutes this.lndEffects.setQueryRoutes

@ -12,11 +12,10 @@ import { LoggerService } from '../../../shared/services/logger.service';
import { newlyAddedRowAnimation } from '../../../shared/animation/row-animation'; import { newlyAddedRowAnimation } from '../../../shared/animation/row-animation';
import { LNDEffects } from '../../store/lnd.effects'; import { LNDEffects } from '../../store/lnd.effects';
import * as LNDActions from '../../store/lnd.actions';
import * as fromLNDReducer from '../../store/lnd.reducers';
import { RTLEffects } from '../../../store/rtl.effects'; import { RTLEffects } from '../../../store/rtl.effects';
import * as LNDActions from '../../store/lnd.actions';
import * as RTLActions from '../../../store/rtl.actions'; import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers'; import * as fromApp from '../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-payments', selector: 'rtl-payments',
@ -40,8 +39,7 @@ export class PaymentsComponent implements OnInit, OnDestroy {
public flgSticky = false; public flgSticky = false;
private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), 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<fromApp.AppState>, private rtlEffects: RTLEffects, private lndEffects: LNDEffects) {
private lndEffects: LNDEffects, private lndStore: Store<fromLNDReducer.LNDState>) {
switch (true) { switch (true) {
case (window.innerWidth <= 415): case (window.innerWidth <= 415):
this.displayedColumns = ['creation_date', 'fee', 'value']; this.displayedColumns = ['creation_date', 'fee', 'value'];
@ -64,7 +62,7 @@ export class PaymentsComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unsubs[4])) .pipe(takeUntil(this.unsubs[4]))
.subscribe(lndStore => { .subscribe(lndStore => {
this.information = lndStore.information; this.information = lndStore.information;
@ -85,7 +83,7 @@ export class PaymentsComponent implements OnInit, OnDestroy {
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'FetchPayments') { if (effectsErr.action === 'FetchPayments') {
this.flgLoading[0] = 'error'; this.flgLoading[0] = 'error';

@ -13,11 +13,10 @@ import { LoggerService } from '../../shared/services/logger.service';
import { newlyAddedRowAnimation } from '../../shared/animation/row-animation'; import { newlyAddedRowAnimation } from '../../shared/animation/row-animation';
import { LNDEffects } from '../store/lnd.effects'; import { LNDEffects } from '../store/lnd.effects';
import * as LNDActions from '../store/lnd.actions';
import * as fromLNDReducer from '../store/lnd.reducers';
import { RTLEffects } from '../../store/rtl.effects'; import { RTLEffects } from '../../store/rtl.effects';
import * as LNDActions from '../store/lnd.actions';
import * as RTLActions from '../../store/rtl.actions'; import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers'; import * as fromApp from '../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-peers', selector: 'rtl-peers',
@ -37,8 +36,8 @@ export class PeersComponent implements OnInit, OnDestroy {
public flgSticky = false; public flgSticky = false;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), 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<fromApp.AppState>, private rtlEffects: RTLEffects,
private lndStore: Store<fromLNDReducer.LNDState>, private lndEffects: LNDEffects, private actions$: Actions, private router: Router) { private lndEffects: LNDEffects, private actions$: Actions, private router: Router) {
switch (true) { switch (true) {
case (window.innerWidth <= 415): case (window.innerWidth <= 415):
this.displayedColumns = ['detach', 'pub_key', 'alias']; this.displayedColumns = ['detach', 'pub_key', 'alias'];
@ -61,7 +60,7 @@ export class PeersComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unSubs[4])) .pipe(takeUntil(this.unSubs[4]))
.subscribe(lndStore => { .subscribe(lndStore => {
this.information = lndStore.information; this.information = lndStore.information;
@ -81,7 +80,7 @@ export class PeersComponent implements OnInit, OnDestroy {
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unSubs[0])) .pipe(takeUntil(this.unSubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'FetchPeers') { if (effectsErr.action === 'FetchPeers') {
this.flgLoading[0] = 'error'; this.flgLoading[0] = 'error';

@ -10,9 +10,8 @@ import { LoggerService } from '../../shared/services/logger.service';
import { CommonService } from '../../shared/services/common.service'; import { CommonService } from '../../shared/services/common.service';
import * as LNDActions from '../store/lnd.actions'; import * as LNDActions from '../store/lnd.actions';
import * as fromLNDReducer from '../store/lnd.reducers';
import * as RTLActions from '../../store/rtl.actions'; import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers'; import * as fromApp from '../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-routing-peers', selector: 'rtl-routing-peers',
@ -37,8 +36,7 @@ export class RoutingPeersComponent implements OnInit, OnDestroy {
public flgSticky = false; public flgSticky = false;
private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()]; private unsubs: Array<Subject<void>> = [new Subject(), 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<fromApp.AppState>, private actions$: Actions) {
private lndStore: Store<fromLNDReducer.LNDState>, private actions$: Actions) {
switch (true) { switch (true) {
case (window.innerWidth <= 415): case (window.innerWidth <= 415):
this.displayedColumns = ['chan_id', 'events', 'total_amount']; this.displayedColumns = ['chan_id', 'events', 'total_amount'];
@ -65,7 +63,7 @@ export class RoutingPeersComponent implements OnInit, OnDestroy {
this.actions$.pipe(takeUntil(this.unsubs[2]), filter((action) => action.type === RTLActions.RESET_STORE)).subscribe((resetStore: RTLActions.ResetStore) => { this.actions$.pipe(takeUntil(this.unsubs[2]), filter((action) => action.type === RTLActions.RESET_STORE)).subscribe((resetStore: RTLActions.ResetStore) => {
this.onRoutingPeersFetch(); this.onRoutingPeersFetch();
}); });
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unsubs[3])) .pipe(takeUntil(this.unsubs[3]))
.subscribe(lndStore => { .subscribe(lndStore => {
if (undefined !== lndStore.forwardingHistory && undefined !== lndStore.forwardingHistory.forwarding_events) { if (undefined !== lndStore.forwardingHistory && undefined !== lndStore.forwardingHistory.forwarding_events) {
@ -81,7 +79,7 @@ export class RoutingPeersComponent implements OnInit, OnDestroy {
}); });
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'GetForwardingHistory') { if (effectsErr.action === 'GetForwardingHistory') {
this.flgLoading[0] = 'error'; this.flgLoading[0] = 'error';

@ -13,9 +13,9 @@ import { LoggerService } from '../../shared/services/logger.service';
import { GetInfo, Fees, Balance, NetworkInfo, Payment, GraphNode, Transaction, SwitchReq, ListInvoices } from '../../shared/models/lndModels'; import { GetInfo, Fees, Balance, NetworkInfo, Payment, GraphNode, Transaction, SwitchReq, ListInvoices } from '../../shared/models/lndModels';
import * as RTLActions from '../../store/rtl.actions'; import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers';
import * as LNDActions from './lnd.actions'; import * as LNDActions from './lnd.actions';
import * as fromLNDReducer from './lnd.reducers'; import * as fromLNDReducer from './lnd.reducers';
import * as fromApp from '../../store/rtl.reducers';
@Injectable() @Injectable()
export class LNDEffects implements OnDestroy { export class LNDEffects implements OnDestroy {
@ -25,7 +25,7 @@ export class LNDEffects implements OnDestroy {
constructor( constructor(
private actions$: Actions, private actions$: Actions,
private httpClient: HttpClient, private httpClient: HttpClient,
private store: Store<fromLNDReducer.LNDState>, private store: Store<fromApp.AppState>,
private logger: LoggerService, private logger: LoggerService,
public dialog: MatDialog, public dialog: MatDialog,
private router: Router) { } private router: Router) { }
@ -34,7 +34,7 @@ export class LNDEffects implements OnDestroy {
infoFetch = this.actions$.pipe( infoFetch = this.actions$.pipe(
ofType(LNDActions.FETCH_INFO), ofType(LNDActions.FETCH_INFO),
withLatestFrom(this.store.select('rtlRoot')), withLatestFrom(this.store.select('rtlRoot')),
mergeMap(([action, store]: [LNDActions.FetchInfo, fromRTLReducer.State]) => { mergeMap(([action, store]: [LNDActions.FetchInfo, fromApp.RootState]) => {
this.store.dispatch(new RTLActions.ClearEffectError('FetchInfo')); this.store.dispatch(new RTLActions.ClearEffectError('FetchInfo'));
return this.httpClient.get<GetInfo>(environment.GETINFO_API) return this.httpClient.get<GetInfo>(environment.GETINFO_API)
.pipe( .pipe(
@ -43,14 +43,14 @@ export class LNDEffects implements OnDestroy {
if (undefined === info.identity_pubkey) { if (undefined === info.identity_pubkey) {
sessionStorage.removeItem('lndUnlocked'); sessionStorage.removeItem('lndUnlocked');
this.logger.info('Redirecting to Unlock'); this.logger.info('Redirecting to Unlock');
this.store.dispatch(new RTLActions.SetSelNodeInfo({})); // this.store.dispatch(new RTLActions.SetSelNodeInfo({}));
this.router.navigate(['/unlocklnd']); this.router.navigate(['/unlocklnd']);
return { return {
type: LNDActions.SET_INFO, type: LNDActions.SET_INFO,
payload: {} payload: {}
}; };
} else { } else {
this.store.dispatch(new RTLActions.SetSelNodeInfo(info)); // this.store.dispatch(new RTLActions.SetSelNodeInfo(info));
sessionStorage.setItem('lndUnlocked', 'true'); sessionStorage.setItem('lndUnlocked', 'true');
return { return {
type: LNDActions.SET_INFO, type: LNDActions.SET_INFO,
@ -588,7 +588,7 @@ export class LNDEffects implements OnDestroy {
@Effect() @Effect()
sendPayment = this.actions$.pipe( sendPayment = this.actions$.pipe(
ofType(LNDActions.SEND_PAYMENT), ofType(LNDActions.SEND_PAYMENT),
withLatestFrom(this.store.select('rtlRoot')), withLatestFrom(this.store.select('lnd')),
mergeMap(([action, store]: [LNDActions.SendPayment, fromLNDReducer.LNDState]) => { mergeMap(([action, store]: [LNDActions.SendPayment, fromLNDReducer.LNDState]) => {
let queryHeaders = {}; let queryHeaders = {};
if (action.payload[2]) { if (action.payload[2]) {

@ -3,11 +3,6 @@ import {
GetInfo, GetInfoChain, Peer, AddressType, Fees, NetworkInfo, Balance, Channel, GetInfo, GetInfoChain, Peer, AddressType, Fees, NetworkInfo, Balance, Channel,
Payment, ListInvoices, PendingChannels, ClosedChannel, Transaction, SwitchRes, QueryRoutes Payment, ListInvoices, PendingChannels, ClosedChannel, Transaction, SwitchRes, QueryRoutes
} from '../../shared/models/lndModels'; } from '../../shared/models/lndModels';
import * as fromApp from '../../store/rtl.reducers';
export interface FeatureState extends fromApp.State {
lnd: LNDState;
}
export interface LNDState { export interface LNDState {
information: GetInfo; information: GetInfo;
@ -32,7 +27,7 @@ export interface LNDState {
addressTypes: AddressType[]; addressTypes: AddressType[];
} }
export const LNDInitialState: LNDState = { const LNDInitialState: LNDState = {
information: {}, information: {},
peers: [], peers: [],
fees: {}, fees: {},

@ -10,9 +10,8 @@ import { ForwardingEvent } from '../../shared/models/lndModels';
import { LoggerService } from '../../shared/services/logger.service'; import { LoggerService } from '../../shared/services/logger.service';
import * as LNDActions from '../store/lnd.actions'; import * as LNDActions from '../store/lnd.actions';
import * as fromLNDReducer from '../store/lnd.reducers';
import * as RTLActions from '../../store/rtl.actions'; import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers'; import * as fromApp from '../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-forwarding-history', selector: 'rtl-forwarding-history',
@ -32,7 +31,7 @@ export class ForwardingHistoryComponent implements OnInit, OnDestroy {
public flgSticky = false; public flgSticky = false;
private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()]; private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private lndStore: Store<fromLNDReducer.LNDState>, private actions$: Actions) { constructor(private logger: LoggerService, private store: Store<fromApp.AppState>, private actions$: Actions) {
switch (true) { switch (true) {
case (window.innerWidth <= 415): case (window.innerWidth <= 415):
this.displayedColumns = ['timestamp', 'amt_out', 'amt_in']; this.displayedColumns = ['timestamp', 'amt_out', 'amt_in'];
@ -59,7 +58,7 @@ export class ForwardingHistoryComponent implements OnInit, OnDestroy {
this.actions$.pipe(takeUntil(this.unsubs[2]), filter((action) => action.type === RTLActions.RESET_STORE)).subscribe((resetStore: RTLActions.ResetStore) => { this.actions$.pipe(takeUntil(this.unsubs[2]), filter((action) => action.type === RTLActions.RESET_STORE)).subscribe((resetStore: RTLActions.ResetStore) => {
this.onForwardingHistoryFetch(); this.onForwardingHistoryFetch();
}); });
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unsubs[3])) .pipe(takeUntil(this.unsubs[3]))
.subscribe(lndStore => { .subscribe(lndStore => {
if (undefined !== lndStore.forwardingHistory && undefined !== lndStore.forwardingHistory.forwarding_events) { if (undefined !== lndStore.forwardingHistory && undefined !== lndStore.forwardingHistory.forwarding_events) {
@ -77,7 +76,7 @@ export class ForwardingHistoryComponent implements OnInit, OnDestroy {
}); });
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'GetForwardingHistory') { if (effectsErr.action === 'GetForwardingHistory') {
this.flgLoading[0] = 'error'; this.flgLoading[0] = 'error';

@ -10,9 +10,8 @@ import { Transaction } from '../../../shared/models/lndModels';
import { LoggerService } from '../../../shared/services/logger.service'; import { LoggerService } from '../../../shared/services/logger.service';
import * as LNDActions from '../../store/lnd.actions'; import * as LNDActions from '../../store/lnd.actions';
import * as fromLNDReducer from '../../store/lnd.reducers';
import * as RTLActions from '../../../store/rtl.actions'; import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers'; import * as fromApp from '../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-list-transactions', selector: 'rtl-list-transactions',
@ -27,7 +26,7 @@ export class ListTransactionsComponent implements OnInit, OnDestroy {
public flgSticky = false; public flgSticky = false;
private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()]; private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private lndStore: Store<fromLNDReducer.LNDState>, private actions$: Actions) { constructor(private logger: LoggerService, private store: Store<fromApp.AppState>, private actions$: Actions) {
switch (true) { switch (true) {
case (window.innerWidth <= 415): case (window.innerWidth <= 415):
this.displayedColumns = ['dest_addresses', 'total_fees', 'amount']; this.displayedColumns = ['dest_addresses', 'total_fees', 'amount'];
@ -54,7 +53,7 @@ export class ListTransactionsComponent implements OnInit, OnDestroy {
this.actions$.pipe(takeUntil(this.unsubs[2]), filter((action) => action.type === RTLActions.RESET_STORE)).subscribe((resetStore: RTLActions.ResetStore) => { this.actions$.pipe(takeUntil(this.unsubs[2]), filter((action) => action.type === RTLActions.RESET_STORE)).subscribe((resetStore: RTLActions.ResetStore) => {
this.store.dispatch(new LNDActions.FetchTransactions()); this.store.dispatch(new LNDActions.FetchTransactions());
}); });
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unsubs[3])) .pipe(takeUntil(this.unsubs[3]))
.subscribe(lndStore => { .subscribe(lndStore => {
if (undefined !== lndStore.transactions) { if (undefined !== lndStore.transactions) {
@ -67,7 +66,7 @@ export class ListTransactionsComponent implements OnInit, OnDestroy {
}); });
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'FetchTransactions') { if (effectsErr.action === 'FetchTransactions') {
this.flgLoading[0] = 'error'; this.flgLoading[0] = 'error';

@ -10,11 +10,10 @@ import { LoggerService } from '../../../shared/services/logger.service';
import * as sha256 from 'sha256'; import * as sha256 from 'sha256';
import { LNDEffects } from '../../store/lnd.effects'; import { LNDEffects } from '../../store/lnd.effects';
import * as LNDActions from '../../store/lnd.actions';
import * as fromLNDReducer from '../../store/lnd.reducers';
import { RTLEffects } from '../../../store/rtl.effects'; import { RTLEffects } from '../../../store/rtl.effects';
import * as LNDActions from '../../store/lnd.actions';
import * as RTLActions from '../../../store/rtl.actions'; import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers'; import * as fromApp from '../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-send-receive-trans', selector: 'rtl-send-receive-trans',
@ -36,11 +35,10 @@ export class SendReceiveTransComponent implements OnInit, OnDestroy {
public flgCustomAmount = '1'; public flgCustomAmount = '1';
private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; private unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), 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<fromApp.AppState>, private rtlEffects: RTLEffects, private lndEffects: LNDEffects) {}
private lndStore: Store<fromLNDReducer.LNDState>, private lndEffects: LNDEffects) {}
ngOnInit() { ngOnInit() {
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unsubs[5])) .pipe(takeUntil(this.unsubs[5]))
.subscribe(lndStore => { .subscribe(lndStore => {
this.information = lndStore.information; this.information = lndStore.information;
@ -64,7 +62,7 @@ export class SendReceiveTransComponent implements OnInit, OnDestroy {
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'FetchBalance/blockchain') { if (effectsErr.action === 'FetchBalance/blockchain') {
this.flgLoadingWallet = 'error'; this.flgLoadingWallet = 'error';

@ -3,15 +3,15 @@ import { Router } from '@angular/router';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { takeUntil, take } from 'rxjs/operators'; import { takeUntil, take } from 'rxjs/operators';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { FormBuilder, FormGroup, Validators, ValidatorFn, AbstractControl, ValidationErrors } from '@angular/forms'; import { FormBuilder, FormGroup, Validators, ValidatorFn, ValidationErrors } from '@angular/forms';
import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper'; import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
import { MatStepper } from '@angular/material'; import { MatStepper } from '@angular/material';
import { LNDEffects } from '../store/lnd.effects'; import { LNDEffects } from '../store/lnd.effects';
import * as LNDActions from '../store/lnd.actions';
import { RTLEffects } from '../../store/rtl.effects'; import { RTLEffects } from '../../store/rtl.effects';
import * as LNDActions from '../store/lnd.actions';
import * as RTLActions from '../../store/rtl.actions'; import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers'; import * as fromApp from '../../store/rtl.reducers';
export const matchedPasswords: ValidatorFn = (control: FormGroup): ValidationErrors | null => { export const matchedPasswords: ValidatorFn = (control: FormGroup): ValidationErrors | null => {
const initWalletPassword = control.get('initWalletPassword'); const initWalletPassword = control.get('initWalletPassword');
@ -48,7 +48,7 @@ export class UnlockLNDComponent implements OnInit, OnDestroy {
warnRes = true; warnRes = true;
private unsubs = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; private unsubs = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private store: Store<fromRTLReducer.State>, private formBuilder: FormBuilder, private rtlEffects: RTLEffects, constructor(private store: Store<fromApp.AppState>, private formBuilder: FormBuilder, private rtlEffects: RTLEffects,
private lndEffects: LNDEffects, private router: Router) {} private lndEffects: LNDEffects, private router: Router) {}
ngOnInit() { ngOnInit() {

@ -6,7 +6,7 @@ import { LoggerService } from '../../../shared/services/logger.service';
import { AlertData, InputData } from '../../../shared/models/alertData'; import { AlertData, InputData } from '../../../shared/models/alertData';
import * as RTLActions from '../../../store/rtl.actions'; import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers'; import * as fromApp from '../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-confirmation-message', selector: 'rtl-confirmation-message',
@ -24,7 +24,7 @@ export class ConfirmationMessageComponent implements OnInit {
public getInputs: Array<InputData> = [{placeholder: '', inputType: 'text', inputValue: ''}]; public getInputs: Array<InputData> = [{placeholder: '', inputType: 'text', inputValue: ''}];
constructor(public dialogRef: MatDialogRef<ConfirmationMessageComponent>, @Inject(MAT_DIALOG_DATA) public data: AlertData, private logger: LoggerService, constructor(public dialogRef: MatDialogRef<ConfirmationMessageComponent>, @Inject(MAT_DIALOG_DATA) public data: AlertData, private logger: LoggerService,
private store: Store<fromRTLReducer.State>) { } private store: Store<fromApp.AppState>) { }
ngOnInit() { ngOnInit() {
this.flgShowInput = this.data.flgShowInput; this.flgShowInput = this.data.flgShowInput;

@ -1,6 +1,6 @@
<div fxLayout="row" fxLayoutAlign="start center"> <div fxLayout="row" fxLayoutAlign="start center">
<div *ngFor="let menuNode of menuNodes"> <div *ngFor="let menuNode of menuNodes">
<button mat-button *ngIf="undefined === menuNode.children" class="horizontal-button" routerLinkActive="h-active-link" [routerLinkActiveOptions]="{exact: true}" routerLink="{{menuNode.link}}" matTooltip="{{menuNode.name}}" matTooltipPosition="above" (click)="onClick(menuNode)"> <button mat-button *ngIf="undefined === menuNode.children" class="horizontal-button" routerLinkActive="h-active-link" [routerLinkActiveOptions]="{exact: true}" [routerLink]="[{}, menuNode.link]" matTooltip="{{menuNode.name}}" matTooltipPosition="above" (click)="onClick(menuNode)">
<mat-icon class="mat-icon-36">{{menuNode.icon}}</mat-icon> <mat-icon class="mat-icon-36">{{menuNode.icon}}</mat-icon>
</button> </button>
<div *ngIf="undefined !== menuNode.children" fxLayoutAlign="center center"> <div *ngIf="undefined !== menuNode.children" fxLayoutAlign="center center">
@ -9,7 +9,7 @@
</button> </button>
<mat-menu #childMenu="matMenu" xPosition="after" overlapTrigger="false" class="child-menu"> <mat-menu #childMenu="matMenu" xPosition="after" overlapTrigger="false" class="child-menu">
<div *ngFor="let childNode of menuNode.children"> <div *ngFor="let childNode of menuNode.children">
<button mat-button class="horizontal-button bg-primary p-0" fxFlex="100" [routerLinkActive]="'h-active-link'" routerLink="{{childNode.link}}" [routerLinkActiveOptions]="{exact: true}"> <button mat-button class="horizontal-button bg-primary p-0" fxFlex="100" [routerLinkActive]="'h-active-link'" [routerLink]="[{}, childNode.link]" [routerLinkActiveOptions]="{exact: true}">
<mat-icon matTooltip="{{childNode.name}}" matTooltipPosition="after" class="mat-icon-36">{{childNode.icon}}<span *ngIf="childNode.name === 'Pending'" [matBadgeHidden]="numPendingChannels<1" matBadge="{{numPendingChannels}}" matBadgeOverlap="false" matBadgeColor="accent"></span></mat-icon> <mat-icon matTooltip="{{childNode.name}}" matTooltipPosition="after" class="mat-icon-36">{{childNode.icon}}<span *ngIf="childNode.name === 'Pending'" [matBadgeHidden]="numPendingChannels<1" matBadge="{{numPendingChannels}}" matBadgeOverlap="false" matBadgeColor="accent"></span></mat-icon>
</button> </button>
</div> </div>

@ -7,10 +7,9 @@ import { Actions } from '@ngrx/effects';
import { LoggerService } from '../../../services/logger.service'; import { LoggerService } from '../../../services/logger.service';
import { MENU_DATA } from '../../../models/navMenu'; import { MENU_DATA } from '../../../models/navMenu';
import * as fromLNDReducer from '../../../../lnd/store/lnd.reducers';
import { RTLEffects } from '../../../../store/rtl.effects'; import { RTLEffects } from '../../../../store/rtl.effects';
import * as RTLActions from '../../../../store/rtl.actions'; import * as RTLActions from '../../../../store/rtl.actions';
import * as fromRTLReducer from '../../../../store/rtl.reducers'; import * as fromApp from '../../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-horizontal-navigation', selector: 'rtl-horizontal-navigation',
@ -24,13 +23,12 @@ export class HorizontalNavigationComponent implements OnInit {
public numPendingChannels = 0; public numPendingChannels = 0;
private unSubs = [new Subject(), new Subject(), new Subject()]; private unSubs = [new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private actions$: Actions, constructor(private logger: LoggerService, private store: Store<fromApp.AppState>, private actions$: Actions, private rtlEffects: RTLEffects) {
private lndStore: Store<fromLNDReducer.LNDState>, private rtlEffects: RTLEffects) {
this.menuNodes = MENU_DATA.children; this.menuNodes = MENU_DATA.children;
} }
ngOnInit() { ngOnInit() {
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unSubs[0])) .pipe(takeUntil(this.unSubs[0]))
.subscribe(lndStore => { .subscribe(lndStore => {
this.numPendingChannels = lndStore.numberOfPendingChannels; this.numPendingChannels = lndStore.numberOfPendingChannels;

@ -16,7 +16,7 @@
</div> </div>
<mat-tree [dataSource]="navMenus" [treeControl]="treeControl" *ngIf="settings.menuType !== 'Compact'"> <mat-tree [dataSource]="navMenus" [treeControl]="treeControl" *ngIf="settings.menuType !== 'Compact'">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle (click)="onChildNavClicked(node)" matTreeNodePadding [matTreeNodePaddingIndent]="settings.menuType === 'Mini' ? 28 : 40" routerLinkActive="active-link" routerLink="{{node.link}}"> <mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle (click)="onChildNavClicked(node)" matTreeNodePadding [matTreeNodePaddingIndent]="settings.menuType === 'Mini' ? 28 : 40" routerLinkActive="active-link" [routerLink]="[{}, node.link]">
<mat-icon class="mr-1" matTooltip="{{node.name}}" matTooltipPosition="right" [matTooltipDisabled]="settings.menuType !== 'Mini'">{{node.icon}}<span *ngIf="node.name === 'Pending' && settings.menuType === 'Mini'" [matBadgeHidden]="numPendingChannels<1" matBadge="{{numPendingChannels}}" matBadgeOverlap="false" matBadgeColor="accent"></span></mat-icon> <mat-icon class="mr-1" matTooltip="{{node.name}}" matTooltipPosition="right" [matTooltipDisabled]="settings.menuType !== 'Mini'">{{node.icon}}<span *ngIf="node.name === 'Pending' && settings.menuType === 'Mini'" [matBadgeHidden]="numPendingChannels<1" matBadge="{{numPendingChannels}}" matBadgeOverlap="false" matBadgeColor="accent"></span></mat-icon>
<span *ngIf="settings.menuType !== 'Mini'">{{node.name}}<span *ngIf="node.name === 'Pending'" [matBadgeHidden]="numPendingChannels<1" matBadge="{{numPendingChannels}}" matBadgeOverlap="false" matBadgeColor="accent"></span></span> <span *ngIf="settings.menuType !== 'Mini'">{{node.name}}<span *ngIf="node.name === 'Pending'" [matBadgeHidden]="numPendingChannels<1" matBadge="{{numPendingChannels}}" matBadgeOverlap="false" matBadgeColor="accent"></span></span>
</mat-tree-node> </mat-tree-node>
@ -40,7 +40,7 @@
</mat-tree> </mat-tree>
<mat-tree [dataSource]="navMenus" [treeControl]="treeControl" *ngIf="settings.menuType === 'Compact'"> <mat-tree [dataSource]="navMenus" [treeControl]="treeControl" *ngIf="settings.menuType === 'Compact'">
<mat-tree-node fxLayout="column" fxLayoutAlign="center center" *matTreeNodeDef="let node" matTreeNodeToggle (click)="onChildNavClicked(node)" matTreeNodePadding matTreeNodePaddingIndent="60" routerLinkActive="active-link" routerLink="{{node.link}}"> <mat-tree-node fxLayout="column" fxLayoutAlign="center center" *matTreeNodeDef="let node" matTreeNodeToggle (click)="onChildNavClicked(node)" matTreeNodePadding matTreeNodePaddingIndent="60" routerLinkActive="active-link" [routerLink]="[{}, node.link]">
<mat-icon class="mat-icon-36">{{node.icon}}</mat-icon> <mat-icon class="mat-icon-36">{{node.icon}}</mat-icon>
<span>{{node.name}}<span *ngIf="node.name === 'Pending'" [matBadgeHidden]="numPendingChannels<1" matBadge="{{numPendingChannels}}" matBadgeOverlap="false" matBadgeColor="accent"></span></span> <span>{{node.name}}<span *ngIf="node.name === 'Pending'" [matBadgeHidden]="numPendingChannels<1" matBadge="{{numPendingChannels}}" matBadgeOverlap="false" matBadgeColor="accent"></span></span>
</mat-tree-node> </mat-tree-node>

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy, Output, EventEmitter } from '@angular/core'; import { Component, OnInit, OnDestroy, Output, EventEmitter } from '@angular/core';
import { Router } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
import { Subject, Observable, of } from 'rxjs'; import { Subject, Observable, of } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators'; import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
@ -13,10 +13,9 @@ import { Node, Settings, SelNodeInfo, SelNodeInfoChain } from '../../../models/R
import { LoggerService } from '../../../services/logger.service'; import { LoggerService } from '../../../services/logger.service';
import { MenuNode, FlatMenuNode, MENU_DATA } from '../../../models/navMenu'; import { MenuNode, FlatMenuNode, MENU_DATA } from '../../../models/navMenu';
import * as fromLNDReducer from '../../../../lnd/store/lnd.reducers';
import { RTLEffects } from '../../../../store/rtl.effects'; import { RTLEffects } from '../../../../store/rtl.effects';
import * as RTLActions from '../../../../store/rtl.actions'; import * as RTLActions from '../../../../store/rtl.actions';
import * as fromRTLReducer from '../../../../store/rtl.reducers'; import * as fromApp from '../../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-side-navigation', selector: 'rtl-side-navigation',
@ -43,8 +42,7 @@ export class SideNavigationComponent implements OnInit, OnDestroy {
navMenus: MatTreeFlatDataSource<MenuNode, FlatMenuNode>; navMenus: MatTreeFlatDataSource<MenuNode, FlatMenuNode>;
navMenusLogout: MatTreeFlatDataSource<MenuNode, FlatMenuNode>; navMenusLogout: MatTreeFlatDataSource<MenuNode, FlatMenuNode>;
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private actions$: Actions, private rtlEffects: RTLEffects, constructor(private logger: LoggerService, private store: Store<fromApp.AppState>, private actions$: Actions, private rtlEffects: RTLEffects, private router: Router, private activatedRoute: ActivatedRoute) {
private lndStore: Store<fromLNDReducer.LNDState>, private router: Router) {
this.version = environment.VERSION; this.version = environment.VERSION;
if (MENU_DATA.children[MENU_DATA.children.length - 1].id === 100) { if (MENU_DATA.children[MENU_DATA.children.length - 1].id === 100) {
MENU_DATA.children.pop(); MENU_DATA.children.pop();
@ -61,7 +59,7 @@ export class SideNavigationComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unSubs[3])) .pipe(takeUntil(this.unSubs[3]))
.subscribe(lndStore => { .subscribe(lndStore => {
this.numPendingChannels = lndStore ? lndStore.numberOfPendingChannels : -1; this.numPendingChannels = lndStore ? lndStore.numberOfPendingChannels : -1;
@ -69,8 +67,8 @@ export class SideNavigationComponent implements OnInit, OnDestroy {
}); });
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unSubs[0])) .pipe(takeUntil(this.unSubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
this.selNodeInfo = rtlStore.selNodeInfo; // this.selNodeInfo = rtlStore.selNodeInfo;
this.selNode = rtlStore.selNode; this.selNode = rtlStore.selNode;
this.settings = this.selNode.settings; this.settings = this.selNode.settings;
this.showLogout = (sessionStorage.getItem('token')) ? true : false; this.showLogout = (sessionStorage.getItem('token')) ? true : false;
@ -121,7 +119,10 @@ export class SideNavigationComponent implements OnInit, OnDestroy {
this.treeControl.collapseAll(); this.treeControl.collapseAll();
if (node.parentId === 0) { if (node.parentId === 0) {
this.treeControl.expandDescendants(node); this.treeControl.expandDescendants(node);
this.router.navigate([node.link]); console.warn(this.activatedRoute.firstChild);
if (this.activatedRoute.firstChild.children.length > 0) {
this.router.navigate([node.link], {relativeTo: this.activatedRoute.firstChild});
}
} else { } else {
const parentNode = this.treeControl.dataNodes.filter(dataNode => { const parentNode = this.treeControl.dataNodes.filter(dataNode => {
return dataNode.id === node.parentId; return dataNode.id === node.parentId;

@ -9,9 +9,8 @@ import { LoggerService } from '../../../services/logger.service';
import { GetInfo, GetInfoChain } from '../../../models/lndModels'; import { GetInfo, GetInfoChain } from '../../../models/lndModels';
import { environment } from '../../../../../environments/environment'; import { environment } from '../../../../../environments/environment';
import * as fromLNDReducer from '../../../../lnd/store/lnd.reducers';
import { RTLEffects } from '../../../../store/rtl.effects'; import { RTLEffects } from '../../../../store/rtl.effects';
import * as fromRTLReducer from '../../../../store/rtl.reducers'; import * as fromApp from '../../../../store/rtl.reducers';
import * as RTLActions from '../../../../store/rtl.actions'; import * as RTLActions from '../../../../store/rtl.actions';
@Component({ @Component({
@ -28,13 +27,12 @@ export class TopMenuComponent implements OnInit, OnDestroy {
public showLogout = false; public showLogout = false;
private unSubs = [new Subject(), new Subject(), new Subject(), new Subject()]; private unSubs = [new Subject(), 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<fromApp.AppState>, private rtlEffects: RTLEffects, private actions$: Actions) {
private lndStore: Store<fromLNDReducer.LNDState>, private actions$: Actions) {
this.version = environment.VERSION; this.version = environment.VERSION;
} }
ngOnInit() { ngOnInit() {
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unSubs[3])) .pipe(takeUntil(this.unSubs[3]))
.subscribe(lndStore => { .subscribe(lndStore => {
this.information = lndStore ? lndStore.information : {}; this.information = lndStore ? lndStore.information : {};
@ -57,7 +55,7 @@ export class TopMenuComponent implements OnInit, OnDestroy {
}); });
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unSubs[0])) .pipe(takeUntil(this.unSubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
this.selNode = rtlStore.selNode; this.selNode = rtlStore.selNode;
this.showLogout = (sessionStorage.getItem('token')) ? true : false; this.showLogout = (sessionStorage.getItem('token')) ? true : false;
this.logger.info(rtlStore); this.logger.info(rtlStore);

@ -7,9 +7,8 @@ import { Node } from '../../models/RTLconfig';
import { LNDEffects } from '../../../lnd/store/lnd.effects'; import { LNDEffects } from '../../../lnd/store/lnd.effects';
import * as LNDActions from '../../../lnd/store/lnd.actions'; import * as LNDActions from '../../../lnd/store/lnd.actions';
import { RTLEffects } from '../../../store/rtl.effects';
import * as RTLActions from '../../../store/rtl.actions'; import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers'; import * as fromApp from '../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-server-config', selector: 'rtl-server-config',
@ -25,12 +24,12 @@ export class ServerConfigComponent implements OnInit, OnDestroy {
public fileFormat = 'INI'; public fileFormat = 'INI';
private unsubs: Array<Subject<void>> = [new Subject(), new Subject()]; private unsubs: Array<Subject<void>> = [new Subject(), new Subject()];
constructor(private store: Store<fromRTLReducer.State>, private lndEffects: LNDEffects) {} constructor(private store: Store<fromApp.AppState>, private lndEffects: LNDEffects) {}
ngOnInit() { ngOnInit() {
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
if (effectsErr.action === 'fetchConfig') { if (effectsErr.action === 'fetchConfig') {
this.resetData(); this.resetData();

@ -7,9 +7,8 @@ import { Node, RTLConfiguration } from '../../models/RTLconfig';
import { GetInfo } from '../../models/lndModels'; import { GetInfo } from '../../models/lndModels';
import { LoggerService } from '../../services/logger.service'; import { LoggerService } from '../../services/logger.service';
import * as fromLNDReducer from '../../../lnd/store/lnd.reducers';
import * as RTLActions from '../../../store/rtl.actions'; import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers'; import * as fromApp from '../../../store/rtl.reducers';
@Component({ @Component({
selector: 'rtl-settings-nav', selector: 'rtl-settings-nav',
@ -30,10 +29,10 @@ export class SettingsNavComponent implements OnInit, OnDestroy {
unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()]; unsubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
@Output() done: EventEmitter<void> = new EventEmitter(); @Output() done: EventEmitter<void> = new EventEmitter();
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private lndStore: Store<fromLNDReducer.LNDState>) {} constructor(private logger: LoggerService, private store: Store<fromApp.AppState>) {}
ngOnInit() { ngOnInit() {
this.lndStore.select('lnd') this.store.select('lnd')
.pipe(takeUntil(this.unsubs[2])) .pipe(takeUntil(this.unsubs[2]))
.subscribe(lndStore => { .subscribe(lndStore => {
this.information = lndStore ? lndStore.information : {}; this.information = lndStore ? lndStore.information : {};
@ -42,7 +41,7 @@ export class SettingsNavComponent implements OnInit, OnDestroy {
}); });
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0])) .pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
this.appConfig = rtlStore.appConfig; this.appConfig = rtlStore.appConfig;
this.selNode = rtlStore.selNode; this.selNode = rtlStore.selNode;
this.selectedMenu = this.selNode.settings.menu; this.selectedMenu = this.selNode.settings.menu;

@ -6,7 +6,7 @@ import { Store } from '@ngrx/store';
import { Node } from '../../models/RTLconfig'; import { Node } from '../../models/RTLconfig';
import { LoggerService } from '../../services/logger.service'; import { LoggerService } from '../../services/logger.service';
import * as fromRTLReducer from '../../../store/rtl.reducers'; import * as fromApp from '../../../store/rtl.reducers';
import * as RTLActions from '../../../store/rtl.actions'; import * as RTLActions from '../../../store/rtl.actions';
@Component({ @Component({
@ -25,12 +25,12 @@ export class SigninComponent implements OnInit, OnDestroy {
private unsub: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()]; private unsub: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>) { } constructor(private logger: LoggerService, private store: Store<fromApp.AppState>) { }
ngOnInit() { ngOnInit() {
this.store.select('rtlRoot') this.store.select('rtlRoot')
.pipe(takeUntil(this.unsub[0])) .pipe(takeUntil(this.unsub[0]))
.subscribe((rtlStore: fromRTLReducer.State) => { .subscribe((rtlStore: fromApp.RootState) => {
rtlStore.effectErrors.forEach(effectsErr => { rtlStore.effectErrors.forEach(effectsErr => {
this.logger.error(effectsErr); this.logger.error(effectsErr);
}); });

@ -5,28 +5,28 @@ export const MENU_DATA: MenuNode = {
icon: 'root', icon: 'root',
link: 'root', link: 'root',
children: [ children: [
{id: 1, parentId: 0, name: 'Home', icon: 'home', link: '/home'}, {id: 1, parentId: 0, name: 'Home', icon: 'home', link: 'home'},
{id: 2, parentId: 0, name: 'LND Wallet', icon: 'account_balance_wallet', link: '/transsendreceive', children: [ {id: 2, parentId: 0, name: 'LND Wallet', icon: 'account_balance_wallet', link: 'transsendreceive', children: [
{id: 21, parentId: 2, name: 'Send/Receive', icon: 'compare_arrows', link: '/transsendreceive'}, {id: 21, parentId: 2, name: 'Send/Receive', icon: 'compare_arrows', link: 'transsendreceive'},
{id: 22, parentId: 2, name: 'List Transactions', icon: 'list_alt', link: '/translist'}, {id: 22, parentId: 2, name: 'List Transactions', icon: 'list_alt', link: 'translist'},
]}, ]},
{id: 3, parentId: 0, name: 'Peers', icon: 'group', link: '/peers'}, {id: 3, parentId: 0, name: 'Peers', icon: 'group', link: 'peers'},
{id: 4, parentId: 0, name: 'Channels', icon: 'settings_ethernet', link: '/chnlmanage', children: [ {id: 4, parentId: 0, name: 'Channels', icon: 'settings_ethernet', link: 'chnlmanage', children: [
{id: 41, parentId: 4, name: 'Management', icon: 'subtitles', link: '/chnlmanage'}, {id: 41, parentId: 4, name: 'Management', icon: 'subtitles', link: 'chnlmanage'},
{id: 42, parentId: 4, name: 'Pending', icon: 'watch', link: '/chnlpending'}, {id: 42, parentId: 4, name: 'Pending', icon: 'watch', link: 'chnlpending'},
{id: 43, parentId: 4, name: 'Closed', icon: 'watch_later', link: '/chnlclosed'}, {id: 43, parentId: 4, name: 'Closed', icon: 'watch_later', link: 'chnlclosed'},
{id: 44, parentId: 4, name: 'Backup', icon: 'cloud_circle', link: '/chnlbackup'} {id: 44, parentId: 4, name: 'Backup', icon: 'cloud_circle', link: 'chnlbackup'}
]}, ]},
{id: 5, parentId: 0, name: 'Payments', icon: 'payment', link: '/paymentsend', children: [ {id: 5, parentId: 0, name: 'Payments', icon: 'payment', link: 'paymentsend', children: [
{id: 51, parentId: 5, name: 'Send', icon: 'send', link: '/paymentsend'}, {id: 51, parentId: 5, name: 'Send', icon: 'send', link: 'paymentsend'},
{id: 52, parentId: 5, name: 'Query Routes', icon: 'explore', link: '/queryroutes'} {id: 52, parentId: 5, name: 'Query Routes', icon: 'explore', link: 'queryroutes'}
]}, ]},
{id: 6, parentId: 0, name: 'Invoices', icon: 'receipt', link: '/invoices'}, {id: 6, parentId: 0, name: 'Invoices', icon: 'receipt', link: 'invoices'},
{id: 7, parentId: 0, name: 'Forwarding History', icon: 'timeline', link: '/switch'}, {id: 7, parentId: 0, name: 'Forwarding History', icon: 'timeline', link: 'switch'},
{id: 8, parentId: 0, name: 'Routing Peers', icon: 'group_work', link: '/routingpeers'}, {id: 8, parentId: 0, name: 'Routing Peers', icon: 'group_work', link: 'routingpeers'},
{id: 9, parentId: 0, name: 'Lookups', icon: 'search', link: '/lookups'}, {id: 9, parentId: 0, name: 'Lookups', icon: 'search', link: 'lookups'},
{id: 10, parentId: 0, name: 'Node Config', icon: 'perm_data_setting', link: '/sconfig'}, {id: 10, parentId: 0, name: 'Node Config', icon: 'perm_data_setting', link: 'sconfig'},
{id: 11, parentId: 0, name: 'Help', icon: 'help', link: '/help'} {id: 11, parentId: 0, name: 'Help', icon: 'help', link: 'help'}
] ]
}; };

@ -18,7 +18,7 @@ export const FETCH_RTL_CONFIG = 'FETCH_RTL_CONFIG';
export const SET_RTL_CONFIG = 'SET_RTL_CONFIG'; export const SET_RTL_CONFIG = 'SET_RTL_CONFIG';
export const SAVE_SETTINGS = 'SAVE_SETTINGS'; export const SAVE_SETTINGS = 'SAVE_SETTINGS';
export const SET_SELECTED_NODE = 'SET_SELECTED_NODE'; export const SET_SELECTED_NODE = 'SET_SELECTED_NODE';
export const SET_SELECTED_NODE_INFO = 'SET_SELECTED_NODE_INFO'; // export const SET_SELECTED_NODE_INFO = 'SET_SELECTED_NODE_INFO';
export const IS_AUTHORIZED = 'IS_AUTHORIZED'; export const IS_AUTHORIZED = 'IS_AUTHORIZED';
export const IS_AUTHORIZED_RES = 'IS_AUTHORIZED_RES'; export const IS_AUTHORIZED_RES = 'IS_AUTHORIZED_RES';
export const SIGNIN = 'SIGNIN'; export const SIGNIN = 'SIGNIN';
@ -87,10 +87,10 @@ export class SetSelelectedNode implements Action {
constructor(public payload: Node) {} constructor(public payload: Node) {}
} }
export class SetSelNodeInfo implements Action { // export class SetSelNodeInfo implements Action {
readonly type = SET_SELECTED_NODE_INFO; // readonly type = SET_SELECTED_NODE_INFO;
constructor(public payload: SelNodeInfo) {} // constructor(public payload: SelNodeInfo) {}
} // }
export class IsAuthorized implements Action { export class IsAuthorized implements Action {
readonly type = IS_AUTHORIZED; readonly type = IS_AUTHORIZED;
@ -120,5 +120,6 @@ export type RTLActions =
ClearEffectError | EffectError | OpenSpinner | CloseSpinner | ClearEffectError | EffectError | OpenSpinner | CloseSpinner |
FetchRTLConfig | SetRTLConfig | SaveSettings | FetchRTLConfig | SetRTLConfig | SaveSettings |
OpenAlert | CloseAlert | OpenConfirmation | CloseConfirmation | OpenAlert | CloseAlert | OpenConfirmation | CloseConfirmation |
ResetStore | SetSelelectedNode | SetSelNodeInfo | ResetStore | SetSelelectedNode |
// SetSelNodeInfo |
IsAuthorized | IsAuthorizedRes | Signin | Signout | InitAppData; IsAuthorized | IsAuthorizedRes | Signin | Signout | InitAppData;

@ -18,7 +18,7 @@ import { ConfirmationMessageComponent } from '../shared/components/confirmation-
import * as CLActions from '../c-lightning/store/cl.actions'; import * as CLActions from '../c-lightning/store/cl.actions';
import * as LNDActions from '../lnd/store/lnd.actions'; import * as LNDActions from '../lnd/store/lnd.actions';
import * as RTLActions from './rtl.actions'; import * as RTLActions from './rtl.actions';
import * as fromRTLReducer from './rtl.reducers'; import * as fromApp from './rtl.reducers';
@Injectable() @Injectable()
export class RTLEffects implements OnDestroy { export class RTLEffects implements OnDestroy {
@ -28,7 +28,7 @@ export class RTLEffects implements OnDestroy {
constructor( constructor(
private actions$: Actions, private actions$: Actions,
private httpClient: HttpClient, private httpClient: HttpClient,
private store: Store<fromRTLReducer.State>, private store: Store<fromApp.AppState>,
private logger: LoggerService, private logger: LoggerService,
public dialog: MatDialog, public dialog: MatDialog,
private router: Router) { } private router: Router) { }
@ -118,7 +118,7 @@ export class RTLEffects implements OnDestroy {
isAuthorized = this.actions$.pipe( isAuthorized = this.actions$.pipe(
ofType(RTLActions.IS_AUTHORIZED), ofType(RTLActions.IS_AUTHORIZED),
withLatestFrom(this.store.select('rtlRoot')), withLatestFrom(this.store.select('rtlRoot')),
mergeMap(([action, store]: [RTLActions.IsAuthorized, fromRTLReducer.State]) => { mergeMap(([action, store]: [RTLActions.IsAuthorized, fromApp.RootState]) => {
this.store.dispatch(new RTLActions.ClearEffectError('IsAuthorized')); this.store.dispatch(new RTLActions.ClearEffectError('IsAuthorized'));
return this.httpClient.post(environment.AUTHENTICATE_API, { password: action.payload }) return this.httpClient.post(environment.AUTHENTICATE_API, { password: action.payload })
.pipe( .pipe(
@ -155,7 +155,7 @@ export class RTLEffects implements OnDestroy {
authSignin = this.actions$.pipe( authSignin = this.actions$.pipe(
ofType(RTLActions.SIGNIN), ofType(RTLActions.SIGNIN),
withLatestFrom(this.store.select('rtlRoot')), withLatestFrom(this.store.select('rtlRoot')),
mergeMap(([action, store]: [RTLActions.Signin, fromRTLReducer.State]) => { mergeMap(([action, store]: [RTLActions.Signin, fromApp.RootState]) => {
this.store.dispatch(new RTLActions.ClearEffectError('Signin')); this.store.dispatch(new RTLActions.ClearEffectError('Signin'));
return this.httpClient.post(environment.AUTHENTICATE_API, { password: action.payload }) return this.httpClient.post(environment.AUTHENTICATE_API, { password: action.payload })
.pipe( .pipe(
@ -184,7 +184,7 @@ export class RTLEffects implements OnDestroy {
signOut = this.actions$.pipe( signOut = this.actions$.pipe(
ofType(RTLActions.SIGNOUT), ofType(RTLActions.SIGNOUT),
withLatestFrom(this.store.select('rtlRoot')), withLatestFrom(this.store.select('rtlRoot')),
mergeMap(([action, store]: [RTLActions.Signout, fromRTLReducer.State]) => { mergeMap(([action, store]: [RTLActions.Signout, fromApp.RootState]) => {
if (+store.appConfig.sso.rtlSSO) { if (+store.appConfig.sso.rtlSSO) {
window.location.href = store.appConfig.sso.logoutRedirectLink; window.location.href = store.appConfig.sso.logoutRedirectLink;
} else { } else {
@ -210,13 +210,9 @@ export class RTLEffects implements OnDestroy {
this.store.dispatch(new RTLActions.ResetStore(action.payload)); this.store.dispatch(new RTLActions.ResetStore(action.payload));
if (action.payload.lnImplementation === 'CLightning') { if (action.payload.lnImplementation === 'CLightning') {
this.router.navigate(['./cl']); this.router.navigate(['./cl']);
this.store.dispatch(new CLActions.ResetCLStore());
this.store.dispatch(new LNDActions.ResetLNDStore());
return { type: CLActions.FETCH_CL_INFO }; return { type: CLActions.FETCH_CL_INFO };
} else { } else {
this.router.navigate(['./lnd']); this.router.navigate(['./lnd']);
this.store.dispatch(new CLActions.ResetCLStore());
this.store.dispatch(new LNDActions.ResetLNDStore());
return { type: LNDActions.FETCH_INFO }; return { type: LNDActions.FETCH_INFO };
} }
} else { } else {

@ -2,17 +2,28 @@ import * as RTLActions from './rtl.actions';
import { ErrorPayload } from '../shared/models/errorPayload'; import { ErrorPayload } from '../shared/models/errorPayload';
import { RTLConfiguration, Node, SelNodeInfo } from '../shared/models/RTLconfig'; import { RTLConfiguration, Node, SelNodeInfo } from '../shared/models/RTLconfig';
export interface State { import { ActionReducerMap } from '@ngrx/store';
import * as fromLND from '../lnd/store/lnd.reducers';
import * as fromCL from '../c-lightning/store/cl.reducers';
export interface AppState {
rtlRoot: RootState;
lnd: fromLND.LNDState;
cl: fromCL.CLState;
}
export interface RootState {
effectErrors: ErrorPayload[]; effectErrors: ErrorPayload[];
selNode: Node; selNode: Node;
appConfig: RTLConfiguration; appConfig: RTLConfiguration;
selNodeInfo: SelNodeInfo; // selNodeInfo: SelNodeInfo;
} }
const initNodeSettings = { flgSidenavOpened: true, flgSidenavPinned: true, menu: 'Vertical', menuType: 'Regular', theme: 'dark-blue', satsToBTC: false }; const initNodeSettings = { flgSidenavOpened: true, flgSidenavPinned: true, menu: 'Vertical', menuType: 'Regular', theme: 'dark-blue', satsToBTC: false };
const initNodeAuthentication = { nodeAuthType: 'CUSTOM', lndConfigPath: '', bitcoindConfigPath: '' }; const initNodeAuthentication = { nodeAuthType: 'CUSTOM', lndConfigPath: '', bitcoindConfigPath: '' };
const initialState: State = { const initialState: RootState = {
effectErrors: [], effectErrors: [],
selNode: {settings: initNodeSettings, authentication: initNodeAuthentication}, selNode: {settings: initNodeSettings, authentication: initNodeAuthentication},
appConfig: { appConfig: {
@ -20,7 +31,7 @@ const initialState: State = {
sso: { rtlSSO: 0, logoutRedirectLink: '/login' }, sso: { rtlSSO: 0, logoutRedirectLink: '/login' },
nodes: [{ settings: initNodeSettings, authentication: initNodeAuthentication}] nodes: [{ settings: initNodeSettings, authentication: initNodeAuthentication}]
}, },
selNodeInfo: {} // selNodeInfo: {}
}; };
export function RTLRootReducer(state = initialState, action: RTLActions.RTLActions) { export function RTLRootReducer(state = initialState, action: RTLActions.RTLActions) {
@ -59,13 +70,20 @@ export function RTLRootReducer(state = initialState, action: RTLActions.RTLActio
selNode: action.payload.nodes.find(node => +node.index === action.payload.selectedNodeIndex), selNode: action.payload.nodes.find(node => +node.index === action.payload.selectedNodeIndex),
appConfig: action.payload appConfig: action.payload
}; };
case RTLActions.SET_SELECTED_NODE_INFO: // case RTLActions.SET_SELECTED_NODE_INFO:
return { // return {
...state, // ...state,
selNodeInfo: action.payload // selNodeInfo: action.payload
}; // };
default: default:
return state; return state;
} }
} }
export const appReducer: ActionReducerMap<AppState> = {
rtlRoot: RTLRootReducer,
lnd: fromLND.LNDReducer,
cl: fromCL.CLReducer
};

Loading…
Cancel
Save