From a1a507a44d72ab88779be77d7baf87d1757689d6 Mon Sep 17 00:00:00 2001 From: Shahana Farooqui <23240721+ShahanaFarooqui@users.noreply.github.com> Date: Thu, 11 Aug 2022 02:17:43 -0700 Subject: [PATCH] Fixing lint and test errors Fixing lint and test errors --- .github/workflows/checks.yml | 2 ++ package.json | 3 ++- server/controllers/cln/webSocketClient.ts | 2 +- server/controllers/eclair/webSocketClient.ts | 2 +- server/controllers/lnd/webSocketClient.ts | 2 +- server/utils/app.ts | 8 ++++---- server/utils/common.ts | 12 ++++++------ server/utils/webSocketServer.ts | 8 ++++---- src/app/cln/graph/graph.component.ts | 2 +- src/app/cln/graph/lookups/lookups.component.ts | 2 +- .../query-routes/query-routes.component.ts | 4 ++-- src/app/cln/home/home.component.ts | 9 ++++----- .../cln/home/node-info/node-info.component.ts | 2 +- .../liquidity-ads-list.component.ts | 2 +- .../cln/network-info/network-info.component.ts | 2 +- .../on-chain-send-modal.component.ts | 2 +- .../on-chain-send/on-chain-send.component.ts | 2 +- src/app/cln/on-chain/on-chain.component.ts | 2 +- .../utxo-tables/utxo-tables.component.ts | 2 +- .../utxo-tables/utxos/utxos.component.ts | 6 +++--- .../bump-fee-modal/bump-fee.component.ts | 2 +- .../channel-open-table.component.ts | 16 ++++++++-------- .../channel-pending-table.component.ts | 6 +++--- .../channels-tables.component.ts | 2 +- .../open-channel.component.ts | 2 +- .../connect-peer/connect-peer.component.ts | 2 +- .../peers-channels/connections.component.ts | 2 +- .../peers-channels/peers/peers.component.ts | 6 +++--- src/app/cln/reports/reports.component.ts | 2 +- .../transactions-report.component.ts | 2 +- .../forwarding-history.component.spec.ts | 2 ++ .../routing-peers/routing-peers.component.ts | 6 +++--- src/app/cln/routing/routing.component.ts | 2 +- .../sign-verify-message.component.ts | 2 +- .../sign-verify-message/sign/sign.component.ts | 2 +- .../verify/verify.component.ts | 2 +- .../create-invoice.component.ts | 2 +- .../invoice-information.component.ts | 2 +- .../lightning-invoices-table.component.ts | 6 +++--- .../create-offer.component.ts | 2 +- .../offer-bookmarks-table.component.ts | 6 +++--- .../offer-information.component.ts | 2 +- .../offers-table/offers-table.component.ts | 6 +++--- .../payments/lightning-payments.component.ts | 6 +++--- .../send-payment.component.ts | 2 +- .../cln/transactions/transactions.component.ts | 2 +- src/app/eclair/graph/graph.component.ts | 2 +- .../eclair/graph/lookups/lookups.component.ts | 2 +- .../query-routes/query-routes.component.ts | 2 +- src/app/eclair/home/home.component.ts | 2 +- .../on-chain-send-modal.component.ts | 2 +- .../on-chain-send/on-chain-send.component.ts | 2 +- .../on-chain-transaction-history.component.ts | 6 +++--- src/app/eclair/on-chain/on-chain.component.ts | 2 +- .../channel-inactive-table.component.ts | 12 ++++++------ .../channel-open-table.component.ts | 14 +++++++------- .../channel-pending-table.component.ts | 6 +++--- .../channels-tables.component.ts | 2 +- .../open-channel.component.ts | 2 +- .../connect-peer/connect-peer.component.ts | 2 +- .../peers-channels/connections.component.ts | 2 +- .../peers-channels/peers/peers.component.ts | 6 +++--- src/app/eclair/reports/reports.component.ts | 2 +- .../routing/routing-report.component.ts | 2 +- .../transactions-report.component.ts | 2 +- .../forwarding-history.component.ts | 6 +++--- .../routing-peers/routing-peers.component.ts | 6 +++--- src/app/eclair/routing/routing.component.ts | 2 +- src/app/eclair/store/ecl.effects.ts | 2 +- .../create-invoice.component.ts | 2 +- .../invoice-information.component.ts | 2 +- .../invoices/lightning-invoices.component.ts | 6 +++--- .../payments/lightning-payments.component.ts | 6 +++--- .../send-payment.component.ts | 2 +- .../transactions/transactions.component.ts | 2 +- src/app/lnd/backup/backup.component.ts | 2 +- .../channel-backup-table.component.ts | 6 +++--- .../channel-restore-table.component.ts | 2 +- src/app/lnd/graph/graph.component.ts | 2 +- src/app/lnd/graph/lookups/lookups.component.ts | 2 +- .../query-routes/query-routes.component.ts | 2 +- .../channel-liquidity-info.component.ts | 2 +- src/app/lnd/home/home.component.ts | 2 +- .../lnd/network-info/network-info.component.ts | 2 +- .../on-chain-label-modal.component.ts | 2 +- .../on-chain-send-modal.component.ts | 2 +- .../on-chain-send/on-chain-send.component.ts | 2 +- src/app/lnd/on-chain/on-chain.component.ts | 2 +- .../on-chain-transaction-history.component.ts | 6 +++--- .../utxo-tables/utxo-tables.component.ts | 2 +- .../utxo-tables/utxos/utxos.component.ts | 6 +++--- .../bump-fee-modal/bump-fee.component.ts | 2 +- .../channel-rebalance.component.ts | 2 +- .../channel-active-htlcs-table.component.ts | 6 +++--- .../channel-closed-table.component.ts | 6 +++--- .../channel-open-table.component.ts | 16 ++++++++-------- .../channel-pending-table.component.ts | 6 +++--- .../channels-tables.component.ts | 2 +- .../close-channel.component.ts | 2 +- .../open-channel.component.ts | 2 +- .../connect-peer/connect-peer.component.ts | 2 +- .../peers-channels/connections.component.ts | 2 +- .../peers-channels/peers/peers.component.ts | 6 +++--- src/app/lnd/reports/reports.component.ts | 2 +- .../routing/routing-report.component.ts | 2 +- .../transactions-report.component.ts | 6 +++--- .../forwarding-history.component.ts | 6 +++--- .../non-routing-peers.component.ts | 8 ++++---- .../routing-peers/routing-peers.component.ts | 6 +++--- src/app/lnd/routing/routing.component.ts | 2 +- .../sign-verify-message.component.ts | 2 +- .../sign-verify-message/sign/sign.component.ts | 6 +++--- .../verify/verify.component.ts | 6 +++--- src/app/lnd/store/lnd.effects.ts | 2 +- .../create-invoice.component.ts | 2 +- .../invoice-information.component.ts | 2 +- .../invoices/lightning-invoices.component.ts | 6 +++--- .../lookup-transactions.component.ts | 2 +- .../payment-lookup/payment-lookup.component.ts | 2 +- .../payments/lightning-payments.component.ts | 6 +++--- .../send-payment.component.spec.ts | 6 ++---- .../send-payment.component.ts | 18 +++++++++--------- .../lnd/transactions/transactions.component.ts | 2 +- .../currency-unit-converter.component.ts | 2 +- .../shared/components/help/help.component.ts | 2 +- .../shared/components/login/login.component.ts | 2 +- .../side-navigation.component.ts | 2 +- .../navigation/top-menu/top-menu.component.ts | 2 +- .../lnp-config/lnp-config.component.ts | 2 +- .../node-config/node-config.component.ts | 2 +- .../services-settings.component.ts | 2 +- .../services/boltz/boltz-root.component.ts | 2 +- .../boltz/swap-modal/swap-modal.component.ts | 2 +- .../services/boltz/swaps/swaps.component.ts | 2 +- .../loop/loop-modal/loop-modal.component.ts | 2 +- .../components/services/loop/loop.component.ts | 2 +- .../services/loop/swaps/swaps.component.ts | 2 +- .../components/services/services.component.ts | 2 +- .../bitcoin-config/bitcoin-config.component.ts | 2 +- .../components/settings/settings.component.ts | 2 +- src/app/shared/models/eclModels.ts | 4 ++-- src/app/shared/models/lndModels.ts | 15 ++------------- src/app/shared/services/boltz.service.ts | 2 +- src/app/shared/services/data.service.ts | 2 +- src/app/shared/services/loop.service.ts | 2 +- src/app/shared/services/session.service.ts | 2 +- src/app/shared/test-helpers/mock-services.ts | 2 +- src/app/store/rtl.effects.ts | 2 +- 148 files changed, 263 insertions(+), 272 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 093d12af..f0aaa1fd 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -62,6 +62,8 @@ jobs: - name: Lint Scripts run: npm run lint + - name: Lint Server Script + run: npm run lintServer test: name: Test diff --git a/package.json b/package.json index cc0386f4..504f5b76 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "serverUbuntu": "NODE_ENV=development nodemon ./rtl.js", "testdev": "ng test --watch=true --code-coverage", "test": "ng test --watch=false", - "lint": "ng lint" + "lint": "ng lint", + "lintServer": "eslint ./server/**/* --ext .ts" }, "private": true, "dependencies": { diff --git a/server/controllers/cln/webSocketClient.ts b/server/controllers/cln/webSocketClient.ts index cde6dd8f..ecc97904 100644 --- a/server/controllers/cln/webSocketClient.ts +++ b/server/controllers/cln/webSocketClient.ts @@ -114,7 +114,7 @@ export class CLWebSocketClient { if (!newClient) { newClient = { selectedNode: null, reConnect: true, webSocketClient: null }; } newClient.selectedNode = JSON.parse(JSON.stringify(newSelectedNode)); this.webSocketClients[clientIdx] = newClient; - } + }; } diff --git a/server/controllers/eclair/webSocketClient.ts b/server/controllers/eclair/webSocketClient.ts index f379fd78..6841af34 100644 --- a/server/controllers/eclair/webSocketClient.ts +++ b/server/controllers/eclair/webSocketClient.ts @@ -112,7 +112,7 @@ export class ECLWebSocketClient { if (!newClient) { newClient = { selectedNode: null, reConnect: true, webSocketClient: null }; } newClient.selectedNode = JSON.parse(JSON.stringify(newSelectedNode)); this.webSocketClients[clientIdx] = newClient; - } + }; } diff --git a/server/controllers/lnd/webSocketClient.ts b/server/controllers/lnd/webSocketClient.ts index efdadf25..9e4bc2ae 100644 --- a/server/controllers/lnd/webSocketClient.ts +++ b/server/controllers/lnd/webSocketClient.ts @@ -125,7 +125,7 @@ export class LNDWebSocketClient { if (this.webSocketClients[clientIdx].selectedNode.ln_version === '' || !this.webSocketClients[clientIdx].selectedNode.ln_version || this.common.isVersionCompatible(this.webSocketClients[clientIdx].selectedNode.ln_version, '0.11.0')) { this.fetchUnpaidInvoices(this.webSocketClients[clientIdx].selectedNode); } - } + }; } diff --git a/server/utils/app.ts b/server/utils/app.ts index d264885d..e4751145 100644 --- a/server/utils/app.ts +++ b/server/utils/app.ts @@ -49,11 +49,11 @@ export class ExpressApplication { public loadConfiguration = () => { this.config.setServerConfiguration(); - } + }; - public setCORS = () => { CORS.mount(this.app); } + public setCORS = () => { CORS.mount(this.app); }; - public setCSRF = () => { CSRF.mount(this.app); } + public setCSRF = () => { CSRF.mount(this.app); }; public setApplicationRoutes = () => { this.logger.log({ selectedNode: this.common.initSelectedNode, level: 'INFO', fileName: 'App', msg: 'Setting up Application Routes..' }); @@ -71,7 +71,7 @@ export class ExpressApplication { }); this.app.use((err, req, res, next) => this.handleApplicationErrors(err, res)); this.logger.log({ selectedNode: this.common.initSelectedNode, level: 'INFO', fileName: 'App', msg: 'Application Routes Set' }); - } + }; public handleApplicationErrors = (err, res) => { switch (err.code) { diff --git a/server/utils/common.ts b/server/utils/common.ts index 2c291316..f1f68a3b 100644 --- a/server/utils/common.ts +++ b/server/utils/common.ts @@ -331,7 +331,7 @@ export class CommonService { throw new Error(err); } } - } + }; public refreshCookie = () => { try { @@ -341,7 +341,7 @@ export class CommonService { this.logger.log({ selectedNode: this.initSelectedNode, level: 'ERROR', fileName: 'Common', msg: 'Something went wrong while refreshing cookie', error: err }); throw new Error(err); } - } + }; public createDirectory = (directoryName) => { const initDir = isAbsolute(directoryName) ? sep : ''; @@ -377,7 +377,7 @@ export class CommonService { } catch (err) { this.logger.log({ selectedNode: this.initSelectedNode, level: 'ERROR', fileName: 'Common', msg: 'Password hashing failed', error: err }); } - } + }; public getAllNodeAllChannelBackup = (node: CommonSelectedNode) => { const channel_backup_file = node.channel_backup_path + sep + 'channel-all.bak'; @@ -419,7 +419,7 @@ export class CommonService { (+versionsArr[0] === +checkVersionsArr[0] && +versionsArr[1] === +checkVersionsArr[1] && +versionsArr[2] >= +checkVersionsArr[2]); } return false; - } + }; public getMonthDays = (selMonth, selYear) => ((selMonth === 1 && selYear % 4 === 0) ? (this.MONTHS[selMonth].days + 1) : this.MONTHS[selMonth].days); @@ -438,7 +438,7 @@ export class CommonService { this.logger.log({ selectedNode: selNode, level: 'INFO', fileName: 'Config Setup Variable', msg: 'LN SERVER URL: ' + selNode.ln_server_url }); this.logger.log({ selectedNode: selNode, level: 'INFO', fileName: 'Config Setup Variable', msg: 'LOGOUT REDIRECT LINK: ' + this.logout_redirect_link + '\r\n' }); } - } + }; public filterData = (dataKey, lnImplementation) => { let search_string = ''; @@ -473,7 +473,7 @@ export class CommonService { const foundDataLine = this.dummy_data_array_from_file.find((dataItem) => dataItem.includes(search_string)); const dataStr = foundDataLine ? foundDataLine.substring((foundDataLine.indexOf(search_string)) + search_string.length) : '{}'; return JSON.parse(dataStr); - } + }; } diff --git a/server/utils/webSocketServer.ts b/server/utils/webSocketServer.ts index 562ef8e5..ff7062fd 100644 --- a/server/utils/webSocketServer.ts +++ b/server/utils/webSocketServer.ts @@ -49,7 +49,7 @@ export class RTLWebSocketServer { this.webSocketServer.on('connection', this.mountEventsOnConnection); this.webSocketServer.on('close', () => clearInterval(this.pingInterval)); this.logger.log({ selectedNode: this.common.initSelectedNode, level: 'INFO', fileName: 'WebSocketServer', msg: 'Websocket Server Connected' }); - } + }; public upgradeCallback = (websocket, request) => { this.webSocketServer.emit('connection', websocket, request); @@ -89,7 +89,7 @@ export class RTLWebSocketServer { const selectedNode = this.common.findNode(currNodeIndex); this.logger.log({ selectedNode: !selectedNode ? this.common.initSelectedNode : selectedNode, level: 'ERROR', fileName: 'WebSocketServer', msg: 'Invalid Node Selection. Previous and current node indices can not be less than zero.' }); } - } + }; public disconnectFromNodeClient = (sessionId: string, prevNodeIndex: number) => { const foundClient = this.clientDetails.find((clientDetail) => clientDetail.index === +prevNodeIndex); @@ -119,7 +119,7 @@ export class RTLWebSocketServer { } } } - } + }; public connectToNodeClient = (sessionId: string, currNodeIndex: number) => { let foundClient = this.clientDetails.find((clientDetail) => clientDetail.index === +currNodeIndex); @@ -148,7 +148,7 @@ export class RTLWebSocketServer { } } } - } + }; public sendErrorToAllLNClients = (serverError, selectedNode: CommonSelectedNode) => { try { diff --git a/src/app/cln/graph/graph.component.ts b/src/app/cln/graph/graph.component.ts index 1a5b3e5b..6ad08c90 100644 --- a/src/app/cln/graph/graph.component.ts +++ b/src/app/cln/graph/graph.component.ts @@ -32,7 +32,7 @@ export class CLNGraphComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/graph/lookups/lookups.component.ts b/src/app/cln/graph/lookups/lookups.component.ts index e90d8f69..1f4fba95 100644 --- a/src/app/cln/graph/lookups/lookups.component.ts +++ b/src/app/cln/graph/lookups/lookups.component.ts @@ -109,7 +109,7 @@ export class CLNLookupsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/graph/query-routes/query-routes.component.ts b/src/app/cln/graph/query-routes/query-routes.component.ts index 175ad1e6..8d4cb1d0 100644 --- a/src/app/cln/graph/query-routes/query-routes.component.ts +++ b/src/app/cln/graph/query-routes/query-routes.component.ts @@ -25,7 +25,7 @@ export class CLNQueryRoutesComponent implements OnInit, OnDestroy { @ViewChild(MatSort, { static: false }) sort: MatSort | undefined; @ViewChild('queryRoutesForm', { static: true }) form: any; public destinationPubkey = ''; - public amount: number = null; + public amount: number | null = null; public qrHops: any; public flgSticky = false; public displayedColumns: any[] = []; @@ -108,7 +108,7 @@ export class CLNQueryRoutesComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/home/home.component.ts b/src/app/cln/home/home.component.ts index 0c0f9436..f79b255a 100644 --- a/src/app/cln/home/home.component.ts +++ b/src/app/cln/home/home.component.ts @@ -1,9 +1,8 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; import { Router } from '@angular/router'; import { Subject } from 'rxjs'; -import { takeUntil, filter, withLatestFrom } from 'rxjs/operators'; +import { takeUntil, withLatestFrom } from 'rxjs/operators'; import { Store } from '@ngrx/store'; -import { Actions } from '@ngrx/effects'; import { faSmile, faFrown } from '@fortawesome/free-regular-svg-icons'; import { faAngleDoubleDown, faAngleDoubleUp, faChartPie, faBolt, faServer, faNetworkWired } from '@fortawesome/free-solid-svg-icons'; @@ -72,7 +71,7 @@ export class CLNHomeComponent implements OnInit, OnDestroy { public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; - constructor(private logger: LoggerService, private store: Store, private actions: Actions, private commonService: CommonService, private router: Router) { + constructor(private logger: LoggerService, private store: Store, private commonService: CommonService, private router: Router) { this.screenSize = this.commonService.getScreenSize(); if (this.screenSize === ScreenSizeEnum.XS) { this.operatorCards = [ @@ -156,8 +155,8 @@ export class CLNHomeComponent implements OnInit, OnDestroy { this.totalOutboundLiquidity = 0; this.activeChannels = channelsSeletor.activeChannels; this.activeChannelsCapacity = JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.activeChannels, 'balancedness'))) || []; - this.allInboundChannels = JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.activeChannels.filter((channel) => channel.msatoshi_to_them ? channel.msatoshi_to_them > 0 : false), 'msatoshi_to_them'))) || []; - this.allOutboundChannels = JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.activeChannels.filter((channel) => channel.msatoshi_to_us ? channel.msatoshi_to_us > 0 : false), 'msatoshi_to_us'))) || []; + this.allInboundChannels = JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.activeChannels.filter((channel) => (channel.msatoshi_to_them ? channel.msatoshi_to_them > 0 : false)), 'msatoshi_to_them'))) || []; + this.allOutboundChannels = JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.activeChannels.filter((channel) => (channel.msatoshi_to_us ? channel.msatoshi_to_us > 0 : false)), 'msatoshi_to_us'))) || []; this.activeChannels.forEach((channel) => { this.totalInboundLiquidity = this.totalInboundLiquidity + Math.ceil((channel.msatoshi_to_them || 0) / 1000); this.totalOutboundLiquidity = this.totalOutboundLiquidity + Math.floor((channel.msatoshi_to_us || 0) / 1000); diff --git a/src/app/cln/home/node-info/node-info.component.ts b/src/app/cln/home/node-info/node-info.component.ts index fc970b04..04c75401 100644 --- a/src/app/cln/home/node-info/node-info.component.ts +++ b/src/app/cln/home/node-info/node-info.component.ts @@ -19,7 +19,7 @@ export class CLNNodeInfoComponent implements OnChanges { if (this.information && this.information.chains && this.information.chains.length > 0) { this.chains = ['']; this.information.chains.forEach((chain) => { - this.chains.push(this.commonService.titleCase(chain.chain) + ' ' + this.commonService.titleCase(chain.network)); + this.chains.push(this.commonService.titleCase(chain.chain || '') + ' ' + this.commonService.titleCase(chain.network || '')); }); } } diff --git a/src/app/cln/liquidity-ads/liquidity-ads-list/liquidity-ads-list.component.ts b/src/app/cln/liquidity-ads/liquidity-ads-list/liquidity-ads-list.component.ts index 046f0a79..d143bd4b 100644 --- a/src/app/cln/liquidity-ads/liquidity-ads-list/liquidity-ads-list.component.ts +++ b/src/app/cln/liquidity-ads/liquidity-ads-list/liquidity-ads-list.component.ts @@ -196,7 +196,7 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/network-info/network-info.component.ts b/src/app/cln/network-info/network-info.component.ts index 4c494d1d..aeeb0598 100644 --- a/src/app/cln/network-info/network-info.component.ts +++ b/src/app/cln/network-info/network-info.component.ts @@ -154,7 +154,7 @@ export class CLNNetworkInfoComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts b/src/app/cln/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts index 6c9b22a1..c1d42bac 100644 --- a/src/app/cln/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts +++ b/src/app/cln/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts @@ -328,7 +328,7 @@ export class CLNOnChainSendModalComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/on-chain/on-chain-send/on-chain-send.component.ts b/src/app/cln/on-chain/on-chain-send/on-chain-send.component.ts index ff0e5617..534ffb96 100644 --- a/src/app/cln/on-chain/on-chain-send/on-chain-send.component.ts +++ b/src/app/cln/on-chain/on-chain-send/on-chain-send.component.ts @@ -40,7 +40,7 @@ export class CLNOnChainSendComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/on-chain/on-chain.component.ts b/src/app/cln/on-chain/on-chain.component.ts index f68c41b5..9a97eac1 100644 --- a/src/app/cln/on-chain/on-chain.component.ts +++ b/src/app/cln/on-chain/on-chain.component.ts @@ -72,7 +72,7 @@ export class CLNOnChainComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/on-chain/utxo-tables/utxo-tables.component.ts b/src/app/cln/on-chain/utxo-tables/utxo-tables.component.ts index d14741ba..3fd2fe41 100644 --- a/src/app/cln/on-chain/utxo-tables/utxo-tables.component.ts +++ b/src/app/cln/on-chain/utxo-tables/utxo-tables.component.ts @@ -50,7 +50,7 @@ export class CLNUTXOTablesComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/on-chain/utxo-tables/utxos/utxos.component.ts b/src/app/cln/on-chain/utxo-tables/utxos/utxos.component.ts index ea079aae..1a7793b5 100644 --- a/src/app/cln/on-chain/utxo-tables/utxos/utxos.component.ts +++ b/src/app/cln/on-chain/utxo-tables/utxos/utxos.component.ts @@ -40,7 +40,7 @@ export class CLNOnChainUtxosComponent implements OnInit, OnChanges, AfterViewIni public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject()]; @@ -67,7 +67,7 @@ export class CLNOnChainUtxosComponent implements OnInit, OnChanges, AfterViewIni this.errorMessage = ''; this.apiCallStatus = utxosSeletor.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.logger.info(utxosSeletor); }); @@ -127,7 +127,7 @@ export class CLNOnChainUtxosComponent implements OnInit, OnChanges, AfterViewIni ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/peers-channels/channels/bump-fee-modal/bump-fee.component.ts b/src/app/cln/peers-channels/channels/bump-fee-modal/bump-fee.component.ts index 3a862a70..bee87f93 100644 --- a/src/app/cln/peers-channels/channels/bump-fee-modal/bump-fee.component.ts +++ b/src/app/cln/peers-channels/channels/bump-fee-modal/bump-fee.component.ts @@ -95,7 +95,7 @@ export class CLNBumpFeeComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts b/src/app/cln/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts index 7651b1ef..43c702c3 100644 --- a/src/app/cln/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts +++ b/src/app/cln/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts @@ -36,7 +36,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe @ViewChild(MatSort, { static: false }) sort: MatSort | undefined; @ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined; public faEye = faEye; - public faEyeSlash = faEyeSlash + public faEyeSlash = faEyeSlash; public totalBalance = 0; public displayedColumns: any[] = []; public channelsData: Channel[] = []; @@ -52,7 +52,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -71,7 +71,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe this.flgSticky = true; this.displayedColumns = ['short_channel_id', 'alias', 'msatoshi_to_us', 'msatoshi_to_them', 'balancedness', 'actions']; } - this.selFilter = this.router.getCurrentNavigation().extras?.state?.filter ? this.router.getCurrentNavigation().extras?.state?.filter : ''; + this.selFilter = this.router?.getCurrentNavigation()?.extras?.state?.filter ? this.router?.getCurrentNavigation()?.extras?.state?.filter : ''; } ngOnInit() { @@ -79,7 +79,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe subscribe((infoBalNumpeersSelector: { information: GetInfo, balance: Balance, numPeers: number }) => { this.information = infoBalNumpeersSelector.information; this.numPeers = infoBalNumpeersSelector.numPeers; - this.totalBalance = infoBalNumpeersSelector.balance.totalBalance; + this.totalBalance = infoBalNumpeersSelector.balance.totalBalance || 0; this.logger.info(infoBalNumpeersSelector); }); this.store.select(channels).pipe(takeUntil(this.unSubs[1])). @@ -87,7 +87,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe this.errorMessage = ''; this.apiCallStatus = channelsSeletor.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.channelsData = channelsSeletor.activeChannels; if (this.channelsData.length > 0) { @@ -104,7 +104,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe } onViewRemotePolicy(selChannel: Channel) { - this.store.dispatch(channelLookup({ payload: { uiMessage: UI_MESSAGES.GET_REMOTE_POLICY, shortChannelID: selChannel.short_channel_id, showError: true } })); + this.store.dispatch(channelLookup({ payload: { uiMessage: UI_MESSAGES.GET_REMOTE_POLICY, shortChannelID: selChannel.short_channel_id || '', showError: true } })); this.clnEffects.setLookupCL.pipe(take(1)).subscribe((resLookup: ChannelEdge[]): boolean | void => { if (resLookup.length === 0) { return false; @@ -233,7 +233,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe pipe(takeUntil(this.unSubs[3])). subscribe((confirmRes) => { if (confirmRes) { - this.store.dispatch(closeChannel({ payload: { id: channelToClose.id, channelId: channelToClose.channel_id, force: false } })); + this.store.dispatch(closeChannel({ payload: { id: channelToClose.id || '', channelId: channelToClose.channel_id || '', force: false } })); } }); } @@ -281,7 +281,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts b/src/app/cln/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts index b1873446..f6beddbd 100644 --- a/src/app/cln/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts +++ b/src/app/cln/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts @@ -49,7 +49,7 @@ export class CLNChannelPendingTableComponent implements OnInit, AfterViewInit, O public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -86,7 +86,7 @@ export class CLNChannelPendingTableComponent implements OnInit, AfterViewInit, O this.errorMessage = ''; this.apiCallStatus = channelsSeletor.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.channelsData = [...channelsSeletor.pendingChannels, ...channelsSeletor.inactiveChannels]; this.channelsData = this.channelsData.sort((a, b) => ((this.CLNChannelPendingState[a.state] >= this.CLNChannelPendingState[b.state]) ? 1 : -1)); @@ -185,7 +185,7 @@ export class CLNChannelPendingTableComponent implements OnInit, AfterViewInit, O ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/peers-channels/channels/channels-tables/channels-tables.component.ts b/src/app/cln/peers-channels/channels/channels-tables/channels-tables.component.ts index 6d39cd94..426e562c 100644 --- a/src/app/cln/peers-channels/channels/channels-tables/channels-tables.component.ts +++ b/src/app/cln/peers-channels/channels/channels-tables/channels-tables.component.ts @@ -92,7 +92,7 @@ export class CLNChannelsTablesComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/peers-channels/channels/open-channel-modal/open-channel.component.ts b/src/app/cln/peers-channels/channels/open-channel-modal/open-channel.component.ts index e2f12aba..baf863c1 100644 --- a/src/app/cln/peers-channels/channels/open-channel-modal/open-channel.component.ts +++ b/src/app/cln/peers-channels/channels/open-channel-modal/open-channel.component.ts @@ -189,7 +189,7 @@ export class CLNOpenChannelComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/peers-channels/connect-peer/connect-peer.component.ts b/src/app/cln/peers-channels/connect-peer/connect-peer.component.ts index 662bba2b..eb3ad8e0 100644 --- a/src/app/cln/peers-channels/connect-peer/connect-peer.component.ts +++ b/src/app/cln/peers-channels/connect-peer/connect-peer.component.ts @@ -186,7 +186,7 @@ export class CLNConnectPeerComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/peers-channels/connections.component.ts b/src/app/cln/peers-channels/connections.component.ts index 22c13e97..bbfd00ff 100644 --- a/src/app/cln/peers-channels/connections.component.ts +++ b/src/app/cln/peers-channels/connections.component.ts @@ -59,7 +59,7 @@ export class CLNConnectionsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/peers-channels/peers/peers.component.ts b/src/app/cln/peers-channels/peers/peers.component.ts index 0b128072..67812311 100644 --- a/src/app/cln/peers-channels/peers/peers.component.ts +++ b/src/app/cln/peers-channels/peers/peers.component.ts @@ -50,7 +50,7 @@ export class CLNPeersComponent implements OnInit, AfterViewInit, OnDestroy { public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject()]; @@ -82,7 +82,7 @@ export class CLNPeersComponent implements OnInit, AfterViewInit, OnDestroy { this.errorMessage = ''; this.apiCallStatus = peersSeletor.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.peersData = peersSeletor.peers || []; if (this.peersData.length > 0) { @@ -209,7 +209,7 @@ export class CLNPeersComponent implements OnInit, AfterViewInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/reports/reports.component.ts b/src/app/cln/reports/reports.component.ts index b398ce09..9de8871c 100644 --- a/src/app/cln/reports/reports.component.ts +++ b/src/app/cln/reports/reports.component.ts @@ -32,7 +32,7 @@ export class CLNReportsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/reports/transactions/transactions-report.component.ts b/src/app/cln/reports/transactions/transactions-report.component.ts index ba448e32..874c9520 100644 --- a/src/app/cln/reports/transactions/transactions-report.component.ts +++ b/src/app/cln/reports/transactions/transactions-report.component.ts @@ -170,7 +170,7 @@ export class CLNTransactionsReportComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/routing/forwarding-history/forwarding-history.component.spec.ts b/src/app/cln/routing/forwarding-history/forwarding-history.component.spec.ts index 39191152..b4a28faa 100644 --- a/src/app/cln/routing/forwarding-history/forwarding-history.component.spec.ts +++ b/src/app/cln/routing/forwarding-history/forwarding-history.component.spec.ts @@ -13,6 +13,7 @@ import { mockDataService, mockLoggerService } from '../../../shared/test-helpers import { SharedModule } from '../../../shared/shared.module'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { DataService } from '../../../shared/services/data.service'; +import { RouterTestingModule } from '@angular/router/testing'; describe('CLNForwardingHistoryComponent', () => { let component: CLNForwardingHistoryComponent; @@ -23,6 +24,7 @@ describe('CLNForwardingHistoryComponent', () => { declarations: [CLNForwardingHistoryComponent], imports: [ BrowserAnimationsModule, + RouterTestingModule, SharedModule, StoreModule.forRoot({ root: RootReducer, lnd: LNDReducer, cln: CLNReducer, ecl: ECLReducer }) ], diff --git a/src/app/cln/routing/routing-peers/routing-peers.component.ts b/src/app/cln/routing/routing-peers/routing-peers.component.ts index 11e8a0dc..a80985ec 100644 --- a/src/app/cln/routing/routing-peers/routing-peers.component.ts +++ b/src/app/cln/routing/routing-peers/routing-peers.component.ts @@ -43,7 +43,7 @@ export class CLNRoutingPeersComponent implements OnInit, OnChanges, AfterViewIni public errorMessage = ''; public filterIn = ''; public filterOut = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject()]; @@ -71,7 +71,7 @@ export class CLNRoutingPeersComponent implements OnInit, OnChanges, AfterViewIni this.errorMessage = ''; this.apiCallStatus = fhSeletor.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.successfulEvents = fhSeletor.forwardingHistory.listForwards || []; if (this.successfulEvents.length > 0 && this.sortIn && this.paginatorIn && this.sortOut && this.paginatorOut) { @@ -157,7 +157,7 @@ export class CLNRoutingPeersComponent implements OnInit, OnChanges, AfterViewIni ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/routing/routing.component.ts b/src/app/cln/routing/routing.component.ts index 3e1d7633..b20f3a7d 100644 --- a/src/app/cln/routing/routing.component.ts +++ b/src/app/cln/routing/routing.component.ts @@ -32,7 +32,7 @@ export class CLNRoutingComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/sign-verify-message/sign-verify-message.component.ts b/src/app/cln/sign-verify-message/sign-verify-message.component.ts index 4c54f885..7935a8dc 100644 --- a/src/app/cln/sign-verify-message/sign-verify-message.component.ts +++ b/src/app/cln/sign-verify-message/sign-verify-message.component.ts @@ -32,7 +32,7 @@ export class CLNSignVerifyMessageComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/sign-verify-message/sign/sign.component.ts b/src/app/cln/sign-verify-message/sign/sign.component.ts index 60444d01..a2d6bc8d 100644 --- a/src/app/cln/sign-verify-message/sign/sign.component.ts +++ b/src/app/cln/sign-verify-message/sign/sign.component.ts @@ -49,7 +49,7 @@ export class CLNSignComponent implements OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/sign-verify-message/verify/verify.component.ts b/src/app/cln/sign-verify-message/verify/verify.component.ts index 022da1db..9503e939 100644 --- a/src/app/cln/sign-verify-message/verify/verify.component.ts +++ b/src/app/cln/sign-verify-message/verify/verify.component.ts @@ -57,7 +57,7 @@ export class CLNVerifyComponent implements OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/transactions/invoices/create-invoice-modal/create-invoice.component.ts b/src/app/cln/transactions/invoices/create-invoice-modal/create-invoice.component.ts index bcf22269..200fe66b 100644 --- a/src/app/cln/transactions/invoices/create-invoice-modal/create-invoice.component.ts +++ b/src/app/cln/transactions/invoices/create-invoice-modal/create-invoice.component.ts @@ -117,7 +117,7 @@ export class CLNCreateInvoiceComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/transactions/invoices/invoice-information-modal/invoice-information.component.ts b/src/app/cln/transactions/invoices/invoice-information-modal/invoice-information.component.ts index 40f27ba9..12954581 100644 --- a/src/app/cln/transactions/invoices/invoice-information-modal/invoice-information.component.ts +++ b/src/app/cln/transactions/invoices/invoice-information-modal/invoice-information.component.ts @@ -76,7 +76,7 @@ export class CLNInvoiceInformationComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.ts b/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.ts index 46f2907d..58aded11 100644 --- a/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.ts +++ b/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.ts @@ -60,7 +60,7 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -93,7 +93,7 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit this.errorMessage = ''; this.apiCallStatus = invoicesSeletor.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.invoiceJSONArr = invoicesSeletor.listInvoices.invoices || []; if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator) { @@ -237,7 +237,7 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/transactions/offers/create-offer-modal/create-offer.component.ts b/src/app/cln/transactions/offers/create-offer-modal/create-offer.component.ts index 2b73b8c9..7c6ae84c 100644 --- a/src/app/cln/transactions/offers/create-offer-modal/create-offer.component.ts +++ b/src/app/cln/transactions/offers/create-offer-modal/create-offer.component.ts @@ -93,7 +93,7 @@ export class CLNCreateOfferComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/transactions/offers/offer-bookmarks-table/offer-bookmarks-table.component.ts b/src/app/cln/transactions/offers/offer-bookmarks-table/offer-bookmarks-table.component.ts index a0050d15..68f13735 100644 --- a/src/app/cln/transactions/offers/offer-bookmarks-table/offer-bookmarks-table.component.ts +++ b/src/app/cln/transactions/offers/offer-bookmarks-table/offer-bookmarks-table.component.ts @@ -44,7 +44,7 @@ export class CLNOfferBookmarksTableComponent implements OnInit, AfterViewInit, O public screenSizeEnum = ScreenSizeEnum; public selFilter = ''; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject()]; @@ -71,7 +71,7 @@ export class CLNOfferBookmarksTableComponent implements OnInit, AfterViewInit, O this.errorMessage = ''; this.apiCallStatus = offerBMsSeletor.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.offersBookmarksJSONArr = offerBMsSeletor.offersBookmarks || []; if (this.offersBookmarksJSONArr && this.offersBookmarksJSONArr.length > 0 && this.sort && this.paginator) { @@ -152,7 +152,7 @@ export class CLNOfferBookmarksTableComponent implements OnInit, AfterViewInit, O ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/transactions/offers/offer-information-modal/offer-information.component.ts b/src/app/cln/transactions/offers/offer-information-modal/offer-information.component.ts index fdc8c25a..22b7debf 100644 --- a/src/app/cln/transactions/offers/offer-information-modal/offer-information.component.ts +++ b/src/app/cln/transactions/offers/offer-information-modal/offer-information.component.ts @@ -76,7 +76,7 @@ export class CLNOfferInformationComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/transactions/offers/offers-table/offers-table.component.ts b/src/app/cln/transactions/offers/offers-table/offers-table.component.ts index 800916ed..127e298f 100644 --- a/src/app/cln/transactions/offers/offers-table/offers-table.component.ts +++ b/src/app/cln/transactions/offers/offers-table/offers-table.component.ts @@ -62,7 +62,7 @@ export class CLNOffersTableComponent implements OnInit, AfterViewInit, OnDestroy public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -95,7 +95,7 @@ export class CLNOffersTableComponent implements OnInit, AfterViewInit, OnDestroy this.errorMessage = ''; this.apiCallStatus = offersSeletor.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.offerJSONArr = offersSeletor.offers || []; if (this.offerJSONArr && this.offerJSONArr.length > 0 && this.sort && this.paginator) { @@ -240,7 +240,7 @@ export class CLNOffersTableComponent implements OnInit, AfterViewInit, OnDestroy ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/transactions/payments/lightning-payments.component.ts b/src/app/cln/transactions/payments/lightning-payments.component.ts index 7a9454ef..a25d16e6 100644 --- a/src/app/cln/transactions/payments/lightning-payments.component.ts +++ b/src/app/cln/transactions/payments/lightning-payments.component.ts @@ -57,7 +57,7 @@ export class CLNLightningPaymentsComponent implements OnInit, AfterViewInit, OnD public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject()]; @@ -94,7 +94,7 @@ export class CLNLightningPaymentsComponent implements OnInit, AfterViewInit, OnD this.errorMessage = ''; this.apiCallStatus = paymentsSeletor.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.paymentJSONArr = paymentsSeletor.payments || []; if (this.paymentJSONArr.length > 0) { @@ -321,7 +321,7 @@ export class CLNLightningPaymentsComponent implements OnInit, AfterViewInit, OnD ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/transactions/send-payment-modal/send-payment.component.ts b/src/app/cln/transactions/send-payment-modal/send-payment.component.ts index 6d61b67a..371fa757 100644 --- a/src/app/cln/transactions/send-payment-modal/send-payment.component.ts +++ b/src/app/cln/transactions/send-payment-modal/send-payment.component.ts @@ -378,7 +378,7 @@ export class CLNLightningSendPaymentsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/cln/transactions/transactions.component.ts b/src/app/cln/transactions/transactions.component.ts index 7be6a86b..4ffd40e3 100644 --- a/src/app/cln/transactions/transactions.component.ts +++ b/src/app/cln/transactions/transactions.component.ts @@ -71,7 +71,7 @@ export class CLNTransactionsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/graph/graph.component.ts b/src/app/eclair/graph/graph.component.ts index 0176639a..18dfaea0 100644 --- a/src/app/eclair/graph/graph.component.ts +++ b/src/app/eclair/graph/graph.component.ts @@ -32,7 +32,7 @@ export class ECLGraphComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/graph/lookups/lookups.component.ts b/src/app/eclair/graph/lookups/lookups.component.ts index 5cb18ffc..6fd04dee 100644 --- a/src/app/eclair/graph/lookups/lookups.component.ts +++ b/src/app/eclair/graph/lookups/lookups.component.ts @@ -125,7 +125,7 @@ export class ECLLookupsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/graph/query-routes/query-routes.component.ts b/src/app/eclair/graph/query-routes/query-routes.component.ts index a7da13e8..f69afced 100644 --- a/src/app/eclair/graph/query-routes/query-routes.component.ts +++ b/src/app/eclair/graph/query-routes/query-routes.component.ts @@ -106,7 +106,7 @@ export class ECLQueryRoutesComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/home/home.component.ts b/src/app/eclair/home/home.component.ts index 6956f822..4b8bf923 100644 --- a/src/app/eclair/home/home.component.ts +++ b/src/app/eclair/home/home.component.ts @@ -197,7 +197,7 @@ export class ECLHomeComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts b/src/app/eclair/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts index 94df4ad7..fd51f6b2 100644 --- a/src/app/eclair/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts +++ b/src/app/eclair/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts @@ -125,7 +125,7 @@ export class ECLOnChainSendModalComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/on-chain/on-chain-send/on-chain-send.component.ts b/src/app/eclair/on-chain/on-chain-send/on-chain-send.component.ts index 3c606033..5b795f67 100644 --- a/src/app/eclair/on-chain/on-chain-send/on-chain-send.component.ts +++ b/src/app/eclair/on-chain/on-chain-send/on-chain-send.component.ts @@ -40,7 +40,7 @@ export class ECLOnChainSendComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/on-chain/on-chain-transaction-history/on-chain-transaction-history.component.ts b/src/app/eclair/on-chain/on-chain-transaction-history/on-chain-transaction-history.component.ts index 0c1d7278..35cce395 100644 --- a/src/app/eclair/on-chain/on-chain-transaction-history/on-chain-transaction-history.component.ts +++ b/src/app/eclair/on-chain/on-chain-transaction-history/on-chain-transaction-history.component.ts @@ -41,7 +41,7 @@ export class ECLOnChainTransactionHistoryComponent implements OnInit, OnDestroy public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unsub: Array> = [new Subject(), new Subject(), new Subject()]; @@ -69,7 +69,7 @@ export class ECLOnChainTransactionHistoryComponent implements OnInit, OnDestroy this.errorMessage = ''; this.apiCallStatus = transactionsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } if (transactionsSelector.transactions) { this.loadTransactionsTable(transactionsSelector.transactions); @@ -124,7 +124,7 @@ export class ECLOnChainTransactionHistoryComponent implements OnInit, OnDestroy ngOnDestroy() { this.unsub.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/on-chain/on-chain.component.ts b/src/app/eclair/on-chain/on-chain.component.ts index 28e4a546..7eae863f 100644 --- a/src/app/eclair/on-chain/on-chain.component.ts +++ b/src/app/eclair/on-chain/on-chain.component.ts @@ -62,7 +62,7 @@ export class ECLOnChainComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/peers-channels/channels/channels-tables/channel-inactive-table/channel-inactive-table.component.ts b/src/app/eclair/peers-channels/channels/channels-tables/channel-inactive-table/channel-inactive-table.component.ts index b148256e..6bc7c1e7 100644 --- a/src/app/eclair/peers-channels/channels/channels-tables/channel-inactive-table/channel-inactive-table.component.ts +++ b/src/app/eclair/peers-channels/channels/channels-tables/channel-inactive-table/channel-inactive-table.component.ts @@ -33,7 +33,7 @@ export class ECLChannelInactiveTableComponent implements OnInit, AfterViewInit, @ViewChild(MatSort, { static: false }) sort: MatSort | undefined; @ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined; public faEye = faEye; - public faEyeSlash = faEyeSlash + public faEyeSlash = faEyeSlash; public inactiveChannels: Channel[]; public totalBalance = 0; public displayedColumns: any[] = []; @@ -49,7 +49,7 @@ export class ECLChannelInactiveTableComponent implements OnInit, AfterViewInit, public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -76,7 +76,7 @@ export class ECLChannelInactiveTableComponent implements OnInit, AfterViewInit, this.errorMessage = ''; this.apiCallStatus = allChannelsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.inactiveChannels = allChannelsSelector.inactiveChannels; this.loadChannelsTable(); @@ -92,7 +92,7 @@ export class ECLChannelInactiveTableComponent implements OnInit, AfterViewInit, }); this.store.select(onchainBalance).pipe(takeUntil(this.unSubs[3])). subscribe((ocBalSelector: { onchainBalance: OnChainBalance, apiCallStatus: ApiCallStatusPayload }) => { - this.totalBalance = ocBalSelector.onchainBalance.total; + this.totalBalance = ocBalSelector.onchainBalance.total || 0; }); } @@ -123,7 +123,7 @@ export class ECLChannelInactiveTableComponent implements OnInit, AfterViewInit, pipe(takeUntil(this.unSubs[4])). subscribe((confirmRes) => { if (confirmRes) { - this.store.dispatch(closeChannel({ payload: { channelId: channelToClose.channelId, force: forceClose } })); + this.store.dispatch(closeChannel({ payload: { channelId: channelToClose.channelId || '', force: forceClose } })); } }); } @@ -163,7 +163,7 @@ export class ECLChannelInactiveTableComponent implements OnInit, AfterViewInit, ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts b/src/app/eclair/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts index eec2f148..1e9f80aa 100644 --- a/src/app/eclair/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts +++ b/src/app/eclair/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts @@ -34,7 +34,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe @ViewChild(MatSort, { static: false }) sort: MatSort | undefined; @ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined; public faEye = faEye; - public faEyeSlash = faEyeSlash + public faEyeSlash = faEyeSlash; public activeChannels: Channel[]; public totalBalance = 0; public displayedColumns: any[] = []; @@ -50,7 +50,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -69,7 +69,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe this.flgSticky = true; this.displayedColumns = ['shortChannelId', 'alias', 'feeBaseMsat', 'feeProportionalMillionths', 'toLocal', 'toRemote', 'balancedness', 'actions']; } - this.selFilter = this.router.getCurrentNavigation().extras?.state?.filter ? this.router.getCurrentNavigation().extras?.state?.filter : ''; + this.selFilter = this.router.getCurrentNavigation()?.extras?.state?.filter ? this.router.getCurrentNavigation()?.extras?.state?.filter : ''; } ngOnInit() { @@ -78,7 +78,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe this.errorMessage = ''; this.apiCallStatus = allChannelsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.activeChannels = allChannelsSelector.activeChannels; if (this.activeChannels.length > 0 && this.sort && this.paginator) { @@ -96,7 +96,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe }); this.store.select(onchainBalance).pipe(takeUntil(this.unSubs[3])). subscribe((ocBalSelector: { onchainBalance: OnChainBalance, apiCallStatus: ApiCallStatusPayload }) => { - this.totalBalance = ocBalSelector.onchainBalance.total; + this.totalBalance = ocBalSelector.onchainBalance.total || 0; }); } @@ -136,7 +136,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe if (confirmRes) { const base_fee = confirmRes[0].inputValue; const fee_rate = confirmRes[1].inputValue; - let updateRequestPayload = null; + let updateRequestPayload: any = null; if (this.commonService.isVersionCompatible(this.information.version, '0.6.2')) { let node_ids = ''; if (channelToUpdate === 'all') { @@ -231,7 +231,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts b/src/app/eclair/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts index 30d7fa54..6abc1669 100644 --- a/src/app/eclair/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts +++ b/src/app/eclair/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts @@ -46,7 +46,7 @@ export class ECLChannelPendingTableComponent implements OnInit, AfterViewInit, O public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -73,7 +73,7 @@ export class ECLChannelPendingTableComponent implements OnInit, AfterViewInit, O this.errorMessage = ''; this.apiCallStatus = allChannelsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.pendingChannels = allChannelsSelector.pendingChannels; this.loadChannelsTable(); @@ -134,7 +134,7 @@ export class ECLChannelPendingTableComponent implements OnInit, AfterViewInit, O ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/peers-channels/channels/channels-tables/channels-tables.component.ts b/src/app/eclair/peers-channels/channels/channels-tables/channels-tables.component.ts index 56dde583..492ad72e 100644 --- a/src/app/eclair/peers-channels/channels/channels-tables/channels-tables.component.ts +++ b/src/app/eclair/peers-channels/channels/channels-tables/channels-tables.component.ts @@ -91,7 +91,7 @@ export class ECLChannelsTablesComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/peers-channels/channels/open-channel-modal/open-channel.component.ts b/src/app/eclair/peers-channels/channels/open-channel-modal/open-channel.component.ts index b00f0a31..7c9f44cc 100644 --- a/src/app/eclair/peers-channels/channels/open-channel-modal/open-channel.component.ts +++ b/src/app/eclair/peers-channels/channels/open-channel-modal/open-channel.component.ts @@ -131,7 +131,7 @@ export class ECLOpenChannelComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/peers-channels/connect-peer/connect-peer.component.ts b/src/app/eclair/peers-channels/connect-peer/connect-peer.component.ts index 93f38147..a76bf322 100644 --- a/src/app/eclair/peers-channels/connect-peer/connect-peer.component.ts +++ b/src/app/eclair/peers-channels/connect-peer/connect-peer.component.ts @@ -151,7 +151,7 @@ export class ECLConnectPeerComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/peers-channels/connections.component.ts b/src/app/eclair/peers-channels/connections.component.ts index 5fe9f5ee..ba7f50e5 100644 --- a/src/app/eclair/peers-channels/connections.component.ts +++ b/src/app/eclair/peers-channels/connections.component.ts @@ -56,7 +56,7 @@ export class ECLConnectionsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/peers-channels/peers/peers.component.ts b/src/app/eclair/peers-channels/peers/peers.component.ts index 94f39a80..3ac4e863 100644 --- a/src/app/eclair/peers-channels/peers/peers.component.ts +++ b/src/app/eclair/peers-channels/peers/peers.component.ts @@ -50,7 +50,7 @@ export class ECLPeersComponent implements OnInit, AfterViewInit, OnDestroy { public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -81,7 +81,7 @@ export class ECLPeersComponent implements OnInit, AfterViewInit, OnDestroy { this.errorMessage = ''; this.apiCallStatus = peersSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.peersData = peersSelector.peers; this.loadPeersTable(this.peersData); @@ -211,7 +211,7 @@ export class ECLPeersComponent implements OnInit, AfterViewInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/reports/reports.component.ts b/src/app/eclair/reports/reports.component.ts index 0bc96f52..a8494893 100644 --- a/src/app/eclair/reports/reports.component.ts +++ b/src/app/eclair/reports/reports.component.ts @@ -32,7 +32,7 @@ export class ECLReportsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/reports/routing/routing-report.component.ts b/src/app/eclair/reports/routing/routing-report.component.ts index 5a389fc0..1b89fa56 100644 --- a/src/app/eclair/reports/routing/routing-report.component.ts +++ b/src/app/eclair/reports/routing/routing-report.component.ts @@ -196,7 +196,7 @@ export class ECLRoutingReportComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/reports/transactions/transactions-report.component.ts b/src/app/eclair/reports/transactions/transactions-report.component.ts index f4f97b6b..7411b119 100644 --- a/src/app/eclair/reports/transactions/transactions-report.component.ts +++ b/src/app/eclair/reports/transactions/transactions-report.component.ts @@ -172,7 +172,7 @@ export class ECLTransactionsReportComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/routing/forwarding-history/forwarding-history.component.ts b/src/app/eclair/routing/forwarding-history/forwarding-history.component.ts index 4b51542d..18a5858e 100644 --- a/src/app/eclair/routing/forwarding-history/forwarding-history.component.ts +++ b/src/app/eclair/routing/forwarding-history/forwarding-history.component.ts @@ -39,7 +39,7 @@ export class ECLForwardingHistoryComponent implements OnInit, OnChanges, AfterVi public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject()]; @@ -67,7 +67,7 @@ export class ECLForwardingHistoryComponent implements OnInit, OnChanges, AfterVi this.errorMessage = ''; this.apiCallStatus = paymentsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.eventsData = paymentsSelector.payments && paymentsSelector.payments.relayed ? paymentsSelector.payments.relayed : []; if (this.eventsData.length > 0 && this.sort && this.paginator) { @@ -160,7 +160,7 @@ export class ECLForwardingHistoryComponent implements OnInit, OnChanges, AfterVi ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/routing/routing-peers/routing-peers.component.ts b/src/app/eclair/routing/routing-peers/routing-peers.component.ts index 8ae2af1b..dd0b5621 100644 --- a/src/app/eclair/routing/routing-peers/routing-peers.component.ts +++ b/src/app/eclair/routing/routing-peers/routing-peers.component.ts @@ -41,7 +41,7 @@ export class ECLRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro public errorMessage = ''; public filterIn = ''; public filterOut = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject()]; @@ -69,7 +69,7 @@ export class ECLRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro this.errorMessage = ''; this.apiCallStatus = paymentsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.routingPeersData = paymentsSelector.payments && paymentsSelector.payments.relayed ? paymentsSelector.payments.relayed : []; if (this.routingPeersData.length > 0 && this.sortIn && this.paginatorIn && this.sortOut && this.paginatorOut) { @@ -141,7 +141,7 @@ export class ECLRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/routing/routing.component.ts b/src/app/eclair/routing/routing.component.ts index 48938c34..e35cad22 100644 --- a/src/app/eclair/routing/routing.component.ts +++ b/src/app/eclair/routing/routing.component.ts @@ -36,7 +36,7 @@ export class ECLRoutingComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/store/ecl.effects.ts b/src/app/eclair/store/ecl.effects.ts index 3bba3c99..1fefb7a2 100644 --- a/src/app/eclair/store/ecl.effects.ts +++ b/src/app/eclair/store/ecl.effects.ts @@ -767,7 +767,7 @@ export class ECLEffects implements OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/transactions/create-invoice-modal/create-invoice.component.ts b/src/app/eclair/transactions/create-invoice-modal/create-invoice.component.ts index 5c7043b8..db166e8d 100644 --- a/src/app/eclair/transactions/create-invoice-modal/create-invoice.component.ts +++ b/src/app/eclair/transactions/create-invoice-modal/create-invoice.component.ts @@ -121,7 +121,7 @@ export class ECLCreateInvoiceComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/transactions/invoice-information-modal/invoice-information.component.ts b/src/app/eclair/transactions/invoice-information-modal/invoice-information.component.ts index 8719146a..a35988cc 100644 --- a/src/app/eclair/transactions/invoice-information-modal/invoice-information.component.ts +++ b/src/app/eclair/transactions/invoice-information-modal/invoice-information.component.ts @@ -75,7 +75,7 @@ export class ECLInvoiceInformationComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/transactions/invoices/lightning-invoices.component.ts b/src/app/eclair/transactions/invoices/lightning-invoices.component.ts index d9559c4f..2b5555f5 100644 --- a/src/app/eclair/transactions/invoices/lightning-invoices.component.ts +++ b/src/app/eclair/transactions/invoices/lightning-invoices.component.ts @@ -57,7 +57,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -92,7 +92,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD this.errorMessage = ''; this.apiCallStatus = invoicesSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.invoiceJSONArr = (invoicesSelector.invoices && invoicesSelector.invoices.length > 0) ? invoicesSelector.invoices : []; if (this.invoiceJSONArr && this.invoiceJSONArr.length > 0 && this.sort && this.paginator) { @@ -211,7 +211,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/transactions/payments/lightning-payments.component.ts b/src/app/eclair/transactions/payments/lightning-payments.component.ts index d9bf66ba..748912aa 100644 --- a/src/app/eclair/transactions/payments/lightning-payments.component.ts +++ b/src/app/eclair/transactions/payments/lightning-payments.component.ts @@ -57,7 +57,7 @@ export class ECLLightningPaymentsComponent implements OnInit, AfterViewInit, OnD public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -96,7 +96,7 @@ export class ECLLightningPaymentsComponent implements OnInit, AfterViewInit, OnD this.errorMessage = ''; this.apiCallStatus = paymentsSeletor.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.paymentJSONArr = (paymentsSeletor.payments && paymentsSeletor.payments.sent && paymentsSeletor.payments.sent.length > 0) ? paymentsSeletor.payments.sent : []; // FOR MPP TESTING START @@ -401,7 +401,7 @@ export class ECLLightningPaymentsComponent implements OnInit, AfterViewInit, OnD ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/transactions/send-payment-modal/send-payment.component.ts b/src/app/eclair/transactions/send-payment-modal/send-payment.component.ts index 2a69239f..02cc292a 100644 --- a/src/app/eclair/transactions/send-payment-modal/send-payment.component.ts +++ b/src/app/eclair/transactions/send-payment-modal/send-payment.component.ts @@ -182,7 +182,7 @@ export class ECLLightningSendPaymentsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/eclair/transactions/transactions.component.ts b/src/app/eclair/transactions/transactions.component.ts index 03289421..b33de827 100644 --- a/src/app/eclair/transactions/transactions.component.ts +++ b/src/app/eclair/transactions/transactions.component.ts @@ -55,7 +55,7 @@ export class ECLTransactionsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/backup/backup.component.ts b/src/app/lnd/backup/backup.component.ts index c88cecf7..88a0f2b3 100644 --- a/src/app/lnd/backup/backup.component.ts +++ b/src/app/lnd/backup/backup.component.ts @@ -32,7 +32,7 @@ export class BackupComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/backup/channel-backup-table/channel-backup-table.component.ts b/src/app/lnd/backup/channel-backup-table/channel-backup-table.component.ts index 2a1d7d83..d3a2aec0 100644 --- a/src/app/lnd/backup/channel-backup-table/channel-backup-table.component.ts +++ b/src/app/lnd/backup/channel-backup-table/channel-backup-table.component.ts @@ -48,7 +48,7 @@ export class ChannelBackupTableComponent implements OnInit, AfterViewInit, OnDes public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject()]; @@ -63,7 +63,7 @@ export class ChannelBackupTableComponent implements OnInit, AfterViewInit, OnDes this.errorMessage = ''; this.apiCallStatus = channelsSeletor.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.channelsData = channelsSeletor.channels; if (this.channelsData.length > 0) { @@ -136,7 +136,7 @@ export class ChannelBackupTableComponent implements OnInit, AfterViewInit, OnDes ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/backup/channel-restore-table/channel-restore-table.component.ts b/src/app/lnd/backup/channel-restore-table/channel-restore-table.component.ts index f95e9d28..73c8cf33 100644 --- a/src/app/lnd/backup/channel-restore-table/channel-restore-table.component.ts +++ b/src/app/lnd/backup/channel-restore-table/channel-restore-table.component.ts @@ -90,7 +90,7 @@ export class ChannelRestoreTableComponent implements OnInit, AfterViewInit, OnDe ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/graph/graph.component.ts b/src/app/lnd/graph/graph.component.ts index edce1d43..400f3a88 100644 --- a/src/app/lnd/graph/graph.component.ts +++ b/src/app/lnd/graph/graph.component.ts @@ -32,7 +32,7 @@ export class GraphComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/graph/lookups/lookups.component.ts b/src/app/lnd/graph/lookups/lookups.component.ts index f8909d1d..38fca255 100644 --- a/src/app/lnd/graph/lookups/lookups.component.ts +++ b/src/app/lnd/graph/lookups/lookups.component.ts @@ -99,7 +99,7 @@ export class LookupsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/graph/query-routes/query-routes.component.ts b/src/app/lnd/graph/query-routes/query-routes.component.ts index 6583aa4b..1b543f06 100644 --- a/src/app/lnd/graph/query-routes/query-routes.component.ts +++ b/src/app/lnd/graph/query-routes/query-routes.component.ts @@ -106,7 +106,7 @@ export class QueryRoutesComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/home/channel-liquidity-info/channel-liquidity-info.component.ts b/src/app/lnd/home/channel-liquidity-info/channel-liquidity-info.component.ts index 8582a75d..38583f93 100644 --- a/src/app/lnd/home/channel-liquidity-info/channel-liquidity-info.component.ts +++ b/src/app/lnd/home/channel-liquidity-info/channel-liquidity-info.component.ts @@ -65,7 +65,7 @@ export class ChannelLiquidityInfoComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/home/home.component.ts b/src/app/lnd/home/home.component.ts index 63a8a30c..7b71ea02 100644 --- a/src/app/lnd/home/home.component.ts +++ b/src/app/lnd/home/home.component.ts @@ -259,7 +259,7 @@ export class HomeComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/network-info/network-info.component.ts b/src/app/lnd/network-info/network-info.component.ts index 76492a73..9026772f 100644 --- a/src/app/lnd/network-info/network-info.component.ts +++ b/src/app/lnd/network-info/network-info.component.ts @@ -128,7 +128,7 @@ export class NetworkInfoComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/on-chain/on-chain-label-modal/on-chain-label-modal.component.ts b/src/app/lnd/on-chain/on-chain-label-modal/on-chain-label-modal.component.ts index 86e13fd8..776dc6fc 100644 --- a/src/app/lnd/on-chain/on-chain-label-modal/on-chain-label-modal.component.ts +++ b/src/app/lnd/on-chain/on-chain-label-modal/on-chain-label-modal.component.ts @@ -61,7 +61,7 @@ export class OnChainLabelModalComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts b/src/app/lnd/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts index fbedb66e..88ff4636 100644 --- a/src/app/lnd/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts +++ b/src/app/lnd/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts @@ -258,7 +258,7 @@ export class OnChainSendModalComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/on-chain/on-chain-send/on-chain-send.component.ts b/src/app/lnd/on-chain/on-chain-send/on-chain-send.component.ts index bcf5bea8..439ee065 100644 --- a/src/app/lnd/on-chain/on-chain-send/on-chain-send.component.ts +++ b/src/app/lnd/on-chain/on-chain-send/on-chain-send.component.ts @@ -40,7 +40,7 @@ export class OnChainSendComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/on-chain/on-chain.component.ts b/src/app/lnd/on-chain/on-chain.component.ts index be867d35..7d468542 100644 --- a/src/app/lnd/on-chain/on-chain.component.ts +++ b/src/app/lnd/on-chain/on-chain.component.ts @@ -59,7 +59,7 @@ export class OnChainComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/on-chain/utxo-tables/on-chain-transaction-history/on-chain-transaction-history.component.ts b/src/app/lnd/on-chain/utxo-tables/on-chain-transaction-history/on-chain-transaction-history.component.ts index c137323d..d9769e3b 100644 --- a/src/app/lnd/on-chain/utxo-tables/on-chain-transaction-history/on-chain-transaction-history.component.ts +++ b/src/app/lnd/on-chain/utxo-tables/on-chain-transaction-history/on-chain-transaction-history.component.ts @@ -41,7 +41,7 @@ export class OnChainTransactionHistoryComponent implements OnInit, OnChanges, On public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject()]; @@ -68,7 +68,7 @@ export class OnChainTransactionHistoryComponent implements OnInit, OnChanges, On this.errorMessage = ''; this.apiCallStatus = transactionsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } if (transactionsSelector.transactions && transactionsSelector.transactions.length > 0) { this.transactions = transactionsSelector.transactions; @@ -133,7 +133,7 @@ export class OnChainTransactionHistoryComponent implements OnInit, OnChanges, On ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/on-chain/utxo-tables/utxo-tables.component.ts b/src/app/lnd/on-chain/utxo-tables/utxo-tables.component.ts index b80ed45a..88f97fb8 100644 --- a/src/app/lnd/on-chain/utxo-tables/utxo-tables.component.ts +++ b/src/app/lnd/on-chain/utxo-tables/utxo-tables.component.ts @@ -53,7 +53,7 @@ export class UTXOTablesComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/on-chain/utxo-tables/utxos/utxos.component.ts b/src/app/lnd/on-chain/utxo-tables/utxos/utxos.component.ts index cb6cf041..9533beca 100644 --- a/src/app/lnd/on-chain/utxo-tables/utxos/utxos.component.ts +++ b/src/app/lnd/on-chain/utxo-tables/utxos/utxos.component.ts @@ -47,7 +47,7 @@ export class OnChainUTXOsComponent implements OnInit, OnChanges, OnDestroy { public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject()]; @@ -74,7 +74,7 @@ export class OnChainUTXOsComponent implements OnInit, OnChanges, OnDestroy { this.errorMessage = ''; this.apiCallStatus = utxosSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } if (utxosSelector.utxos && utxosSelector.utxos.length > 0) { this.dustUtxos = utxosSelector.utxos.filter((utxo) => +utxo.amount_sat < 1000); @@ -190,7 +190,7 @@ export class OnChainUTXOsComponent implements OnInit, OnChanges, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/peers-channels/channels/bump-fee-modal/bump-fee.component.ts b/src/app/lnd/peers-channels/channels/bump-fee-modal/bump-fee.component.ts index 9fa0506c..08666da8 100644 --- a/src/app/lnd/peers-channels/channels/bump-fee-modal/bump-fee.component.ts +++ b/src/app/lnd/peers-channels/channels/bump-fee-modal/bump-fee.component.ts @@ -84,7 +84,7 @@ export class BumpFeeComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/peers-channels/channels/channel-rebalance-modal/channel-rebalance.component.ts b/src/app/lnd/peers-channels/channels/channel-rebalance-modal/channel-rebalance.component.ts index 98f977b6..87c79ce2 100644 --- a/src/app/lnd/peers-channels/channels/channel-rebalance-modal/channel-rebalance.component.ts +++ b/src/app/lnd/peers-channels/channels/channel-rebalance-modal/channel-rebalance.component.ts @@ -283,7 +283,7 @@ export class ChannelRebalanceComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/peers-channels/channels/channels-tables/channel-active-htlcs-table/channel-active-htlcs-table.component.ts b/src/app/lnd/peers-channels/channels/channels-tables/channel-active-htlcs-table/channel-active-htlcs-table.component.ts index f24ed109..ba12c5b6 100644 --- a/src/app/lnd/peers-channels/channels/channels-tables/channel-active-htlcs-table/channel-active-htlcs-table.component.ts +++ b/src/app/lnd/peers-channels/channels/channels-tables/channel-active-htlcs-table/channel-active-htlcs-table.component.ts @@ -40,7 +40,7 @@ export class ChannelActiveHTLCsTableComponent implements OnInit, AfterViewInit, public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject()]; @@ -67,7 +67,7 @@ export class ChannelActiveHTLCsTableComponent implements OnInit, AfterViewInit, this.errorMessage = ''; this.apiCallStatus = channelsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.channelsJSONArr = channelsSelector.channels.filter((channel) => channel.pending_htlcs && channel.pending_htlcs.length > 0) || []; this.loadHTLCsTable(this.channelsJSONArr); @@ -168,7 +168,7 @@ export class ChannelActiveHTLCsTableComponent implements OnInit, AfterViewInit, ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/peers-channels/channels/channels-tables/channel-closed-table/channel-closed-table.component.ts b/src/app/lnd/peers-channels/channels/channels-tables/channel-closed-table/channel-closed-table.component.ts index d416a87e..93f8717a 100644 --- a/src/app/lnd/peers-channels/channels/channels-tables/channel-closed-table/channel-closed-table.component.ts +++ b/src/app/lnd/peers-channels/channels/channels-tables/channel-closed-table/channel-closed-table.component.ts @@ -41,7 +41,7 @@ export class ChannelClosedTableComponent implements OnInit, AfterViewInit, OnDes public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unsub: Array> = [new Subject(), new Subject(), new Subject()]; @@ -65,7 +65,7 @@ export class ChannelClosedTableComponent implements OnInit, AfterViewInit, OnDes this.errorMessage = ''; this.apiCallStatus = closedChannelsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.closedChannelsData = closedChannelsSelector.closedChannels; if (this.closedChannelsData.length > 0) { @@ -127,7 +127,7 @@ export class ChannelClosedTableComponent implements OnInit, AfterViewInit, OnDes ngOnDestroy() { this.unsub.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts b/src/app/lnd/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts index 5caa22d3..5e01b562 100644 --- a/src/app/lnd/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts +++ b/src/app/lnd/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts @@ -56,12 +56,12 @@ export class ChannelOpenTableComponent implements OnInit, AfterViewInit, OnDestr public pageSizeOptions = PAGE_SIZE_OPTIONS; public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; - public versionsArr = []; + public versionsArr: string[] = []; public faEye = faEye; - public faEyeSlash = faEyeSlash + public faEyeSlash = faEyeSlash; private targetConf = 6; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -80,7 +80,7 @@ export class ChannelOpenTableComponent implements OnInit, AfterViewInit, OnDestr this.flgSticky = true; this.displayedColumns = ['remote_alias', 'uptime', 'total_satoshis_sent', 'total_satoshis_received', 'local_balance', 'remote_balance', 'balancedness', 'actions']; } - this.selFilter = this.router.getCurrentNavigation().extras?.state?.filter ? this.router.getCurrentNavigation().extras?.state?.filter : ''; + this.selFilter = this.router.getCurrentNavigation()?.extras?.state?.filter ? this.router.getCurrentNavigation()?.extras?.state?.filter : ''; } ngOnInit() { @@ -101,14 +101,14 @@ export class ChannelOpenTableComponent implements OnInit, AfterViewInit, OnDestr }); this.store.select(blockchainBalance).pipe(takeUntil(this.unSubs[3])). subscribe((bcBalanceSelector: { blockchainBalance: BlockchainBalance, apiCallStatus: ApiCallStatusPayload }) => { - this.totalBalance = +bcBalanceSelector.blockchainBalance.total_balance; + this.totalBalance = bcBalanceSelector.blockchainBalance?.total_balance ? +bcBalanceSelector.blockchainBalance?.total_balance : 0; }); this.store.select(channels).pipe(takeUntil(this.unSubs[4])). subscribe((channelsSelector: { channels: Channel[], channelsSummary: ChannelsSummary, lightningBalance: LightningBalance, apiCallStatus: ApiCallStatusPayload }) => { this.errorMessage = ''; this.apiCallStatus = channelsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.channelsData = this.calculateUptime(channelsSelector.channels); if (this.channelsData.length > 0) { @@ -125,7 +125,7 @@ export class ChannelOpenTableComponent implements OnInit, AfterViewInit, OnDestr } onViewRemotePolicy(selChannel: Channel) { - this.store.dispatch(channelLookup({ payload: { uiMessage: UI_MESSAGES.GET_REMOTE_POLICY, channelID: selChannel.chan_id.toString() + '/' + this.information.identity_pubkey } })); + this.store.dispatch(channelLookup({ payload: { uiMessage: UI_MESSAGES.GET_REMOTE_POLICY, channelID: selChannel.chan_id?.toString() + '/' + this.information.identity_pubkey } })); this.lndEffects.setLookup.pipe(take(1)).subscribe((resLookup): boolean | void => { if (!resLookup.fee_base_msat && !resLookup.fee_rate_milli_msat && !resLookup.time_lock_delta) { return false; @@ -376,7 +376,7 @@ export class ChannelOpenTableComponent implements OnInit, AfterViewInit, OnDestr ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts b/src/app/lnd/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts index 6dbfbbcd..79715622 100644 --- a/src/app/lnd/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts +++ b/src/app/lnd/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts @@ -44,7 +44,7 @@ export class ChannelPendingTableComponent implements OnInit, AfterViewInit, OnDe public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject()]; @@ -76,7 +76,7 @@ export class ChannelPendingTableComponent implements OnInit, AfterViewInit, OnDe this.errorMessage = ''; this.apiCallStatus = pendingChannelsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.pendingChannels = pendingChannelsSelector.pendingChannels; if (this.pendingChannels.pending_open_channels && this.pendingChannels.pending_open_channels.length && this.pendingChannels.pending_open_channels.length > 0) { @@ -272,7 +272,7 @@ export class ChannelPendingTableComponent implements OnInit, AfterViewInit, OnDe ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/peers-channels/channels/channels-tables/channels-tables.component.ts b/src/app/lnd/peers-channels/channels/channels-tables/channels-tables.component.ts index 8408fb60..e354e9c7 100644 --- a/src/app/lnd/peers-channels/channels/channels-tables/channels-tables.component.ts +++ b/src/app/lnd/peers-channels/channels/channels-tables/channels-tables.component.ts @@ -95,7 +95,7 @@ export class ChannelsTablesComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/peers-channels/channels/close-channel-modal/close-channel.component.ts b/src/app/lnd/peers-channels/channels/close-channel-modal/close-channel.component.ts index d44f4ee2..96e55c6e 100644 --- a/src/app/lnd/peers-channels/channels/close-channel-modal/close-channel.component.ts +++ b/src/app/lnd/peers-channels/channels/close-channel-modal/close-channel.component.ts @@ -79,7 +79,7 @@ export class CloseChannelComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/peers-channels/channels/open-channel-modal/open-channel.component.ts b/src/app/lnd/peers-channels/channels/open-channel-modal/open-channel.component.ts index 81b39dd2..46251960 100644 --- a/src/app/lnd/peers-channels/channels/open-channel-modal/open-channel.component.ts +++ b/src/app/lnd/peers-channels/channels/open-channel-modal/open-channel.component.ts @@ -138,7 +138,7 @@ export class OpenChannelComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/peers-channels/connect-peer/connect-peer.component.ts b/src/app/lnd/peers-channels/connect-peer/connect-peer.component.ts index 217aa696..9feef807 100644 --- a/src/app/lnd/peers-channels/connect-peer/connect-peer.component.ts +++ b/src/app/lnd/peers-channels/connect-peer/connect-peer.component.ts @@ -185,7 +185,7 @@ export class ConnectPeerComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/peers-channels/connections.component.ts b/src/app/lnd/peers-channels/connections.component.ts index 5b2b6a0d..9046358d 100644 --- a/src/app/lnd/peers-channels/connections.component.ts +++ b/src/app/lnd/peers-channels/connections.component.ts @@ -64,7 +64,7 @@ export class ConnectionsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/peers-channels/peers/peers.component.ts b/src/app/lnd/peers-channels/peers/peers.component.ts index cc69ca59..399dbf1d 100644 --- a/src/app/lnd/peers-channels/peers/peers.component.ts +++ b/src/app/lnd/peers-channels/peers/peers.component.ts @@ -46,7 +46,7 @@ export class PeersComponent implements OnInit, AfterViewInit, OnDestroy { public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; public selFilter = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject()]; @@ -78,7 +78,7 @@ export class PeersComponent implements OnInit, AfterViewInit, OnDestroy { this.errorMessage = ''; this.apiCallStatus = peersSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.peersData = peersSelector.peers; if (this.peersData.length > 0) { @@ -186,7 +186,7 @@ export class PeersComponent implements OnInit, AfterViewInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/reports/reports.component.ts b/src/app/lnd/reports/reports.component.ts index 0a89c052..85c891ed 100644 --- a/src/app/lnd/reports/reports.component.ts +++ b/src/app/lnd/reports/reports.component.ts @@ -32,7 +32,7 @@ export class ReportsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/reports/routing/routing-report.component.ts b/src/app/lnd/reports/routing/routing-report.component.ts index 8d2ae974..8f604283 100644 --- a/src/app/lnd/reports/routing/routing-report.component.ts +++ b/src/app/lnd/reports/routing/routing-report.component.ts @@ -196,7 +196,7 @@ export class RoutingReportComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/reports/transactions/transactions-report.component.ts b/src/app/lnd/reports/transactions/transactions-report.component.ts index d5c0ffc3..6a4e68d9 100644 --- a/src/app/lnd/reports/transactions/transactions-report.component.ts +++ b/src/app/lnd/reports/transactions/transactions-report.component.ts @@ -43,7 +43,7 @@ export class TransactionsReportComponent implements OnInit, OnDestroy { public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject()]; @@ -60,7 +60,7 @@ export class TransactionsReportComponent implements OnInit, OnDestroy { this.errorMessage = ''; this.apiCallStatus = allLTSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.payments = allLTSelector.allLightningTransactions.listPaymentsAll.payments || []; this.invoices = allLTSelector.allLightningTransactions.listInvoicesAll.invoices || []; @@ -185,7 +185,7 @@ export class TransactionsReportComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/routing/forwarding-history/forwarding-history.component.ts b/src/app/lnd/routing/forwarding-history/forwarding-history.component.ts index e31674b8..3edad6f0 100644 --- a/src/app/lnd/routing/forwarding-history/forwarding-history.component.ts +++ b/src/app/lnd/routing/forwarding-history/forwarding-history.component.ts @@ -40,7 +40,7 @@ export class ForwardingHistoryComponent implements OnInit, AfterViewInit, OnChan public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject()]; @@ -65,7 +65,7 @@ export class ForwardingHistoryComponent implements OnInit, AfterViewInit, OnChan this.errorMessage = ''; this.apiCallStatus = fhSelector.apiCallStatus; if (fhSelector.apiCallStatus?.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.forwardingHistoryData = fhSelector.forwardingHistory.forwarding_events || []; this.loadForwardingEventsTable(this.forwardingHistoryData); @@ -143,7 +143,7 @@ export class ForwardingHistoryComponent implements OnInit, AfterViewInit, OnChan ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.ts b/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.ts index a8a82e62..2488769a 100644 --- a/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.ts +++ b/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.ts @@ -38,7 +38,7 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro public errorMessage = ''; public filter = ''; public activeChannels: Channel[] = []; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject()]; @@ -65,7 +65,7 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro this.errorMessage = ''; this.apiCallStatus = fhSelector.apiCallStatus; if (fhSelector.apiCallStatus?.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } if (fhSelector.forwardingHistory.forwarding_events) { this.routingPeersData = fhSelector.forwardingHistory.forwarding_events; @@ -83,7 +83,7 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro this.errorMessage = ''; this.apiCallStatus = channelsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.activeChannels = channelsSelector.channels; this.logger.info(channelsSelector); @@ -146,7 +146,7 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/routing/routing-peers/routing-peers.component.ts b/src/app/lnd/routing/routing-peers/routing-peers.component.ts index 14acbbe7..30189a28 100644 --- a/src/app/lnd/routing/routing-peers/routing-peers.component.ts +++ b/src/app/lnd/routing/routing-peers/routing-peers.component.ts @@ -41,7 +41,7 @@ export class RoutingPeersComponent implements OnInit, AfterViewInit, OnDestroy { public errorMessage = ''; public filterIn = ''; public filterOut = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject()]; @@ -68,7 +68,7 @@ export class RoutingPeersComponent implements OnInit, AfterViewInit, OnDestroy { this.errorMessage = ''; this.apiCallStatus = fhSelector.apiCallStatus; if (fhSelector.apiCallStatus?.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } if (fhSelector.forwardingHistory.forwarding_events) { this.routingPeersData = fhSelector.forwardingHistory.forwarding_events; @@ -167,7 +167,7 @@ export class RoutingPeersComponent implements OnInit, AfterViewInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/routing/routing.component.ts b/src/app/lnd/routing/routing.component.ts index 1a9204f5..7798b77a 100644 --- a/src/app/lnd/routing/routing.component.ts +++ b/src/app/lnd/routing/routing.component.ts @@ -66,7 +66,7 @@ export class RoutingComponent implements OnInit, OnDestroy { this.resetData(); this.store.dispatch(setForwardingHistory({ payload: { forwarding_events: [] } })); this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/sign-verify-message/sign-verify-message.component.ts b/src/app/lnd/sign-verify-message/sign-verify-message.component.ts index 0e2cdd7d..bd0196e8 100644 --- a/src/app/lnd/sign-verify-message/sign-verify-message.component.ts +++ b/src/app/lnd/sign-verify-message/sign-verify-message.component.ts @@ -32,7 +32,7 @@ export class SignVerifyMessageComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/sign-verify-message/sign/sign.component.ts b/src/app/lnd/sign-verify-message/sign/sign.component.ts index 2a7d01ef..6273e84f 100644 --- a/src/app/lnd/sign-verify-message/sign/sign.component.ts +++ b/src/app/lnd/sign-verify-message/sign/sign.component.ts @@ -18,9 +18,9 @@ export class SignComponent implements OnDestroy { public signature = ''; private unSubs: Array> = [new Subject(), new Subject()]; - constructor(private dataService: DataService, private snackBar: MatSnackBar, private logger: LoggerService) {} + constructor(private dataService: DataService, private snackBar: MatSnackBar, private logger: LoggerService) { } - onSign(): boolean|void { + onSign(): boolean | void { if (!this.message || this.message === '') { return true; } @@ -49,7 +49,7 @@ export class SignComponent implements OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/sign-verify-message/verify/verify.component.ts b/src/app/lnd/sign-verify-message/verify/verify.component.ts index 69e25afc..d54c5e8f 100644 --- a/src/app/lnd/sign-verify-message/verify/verify.component.ts +++ b/src/app/lnd/sign-verify-message/verify/verify.component.ts @@ -21,9 +21,9 @@ export class VerifyComponent implements OnDestroy { public verifyRes = { pubkey: '', valid: null }; private unSubs: Array> = [new Subject(), new Subject()]; - constructor(private dataService: DataService, private snackBar: MatSnackBar, private logger: LoggerService) {} + constructor(private dataService: DataService, private snackBar: MatSnackBar, private logger: LoggerService) { } - onVerify(): boolean|void { + onVerify(): boolean | void { if ((!this.message || this.message === '') || (!this.signature || this.signature === '')) { return true; } @@ -57,7 +57,7 @@ export class VerifyComponent implements OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/store/lnd.effects.ts b/src/app/lnd/store/lnd.effects.ts index f0203658..ca8a1d96 100644 --- a/src/app/lnd/store/lnd.effects.ts +++ b/src/app/lnd/store/lnd.effects.ts @@ -1257,7 +1257,7 @@ export class LNDEffects implements OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/transactions/create-invoice-modal/create-invoice.component.ts b/src/app/lnd/transactions/create-invoice-modal/create-invoice.component.ts index d88b4025..6b06ca75 100644 --- a/src/app/lnd/transactions/create-invoice-modal/create-invoice.component.ts +++ b/src/app/lnd/transactions/create-invoice-modal/create-invoice.component.ts @@ -110,7 +110,7 @@ export class CreateInvoiceComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/transactions/invoice-information-modal/invoice-information.component.ts b/src/app/lnd/transactions/invoice-information-modal/invoice-information.component.ts index 712968b5..c7d03490 100644 --- a/src/app/lnd/transactions/invoice-information-modal/invoice-information.component.ts +++ b/src/app/lnd/transactions/invoice-information-modal/invoice-information.component.ts @@ -97,7 +97,7 @@ export class InvoiceInformationComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/transactions/invoices/lightning-invoices.component.ts b/src/app/lnd/transactions/invoices/lightning-invoices.component.ts index 8cfb7324..ccda8b82 100644 --- a/src/app/lnd/transactions/invoices/lightning-invoices.component.ts +++ b/src/app/lnd/transactions/invoices/lightning-invoices.component.ts @@ -62,7 +62,7 @@ export class LightningInvoicesComponent implements OnInit, AfterViewInit, OnDest public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -91,7 +91,7 @@ export class LightningInvoicesComponent implements OnInit, AfterViewInit, OnDest this.errorMessage = ''; this.apiCallStatus = invoicesSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.totalInvoices = invoicesSelector.listInvoices.total_invoices; this.firstOffset = +invoicesSelector.listInvoices.first_index_offset; @@ -230,7 +230,7 @@ export class LightningInvoicesComponent implements OnInit, AfterViewInit, OnDest ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/transactions/lookup-transactions/lookup-transactions.component.ts b/src/app/lnd/transactions/lookup-transactions/lookup-transactions.component.ts index d33bde22..393c18f7 100644 --- a/src/app/lnd/transactions/lookup-transactions/lookup-transactions.component.ts +++ b/src/app/lnd/transactions/lookup-transactions/lookup-transactions.component.ts @@ -95,7 +95,7 @@ export class LookupTransactionsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/transactions/lookup-transactions/payment-lookup/payment-lookup.component.ts b/src/app/lnd/transactions/lookup-transactions/payment-lookup/payment-lookup.component.ts index e662eda8..aa831922 100644 --- a/src/app/lnd/transactions/lookup-transactions/payment-lookup/payment-lookup.component.ts +++ b/src/app/lnd/transactions/lookup-transactions/payment-lookup/payment-lookup.component.ts @@ -38,7 +38,7 @@ export class PaymentLookupComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/transactions/payments/lightning-payments.component.ts b/src/app/lnd/transactions/payments/lightning-payments.component.ts index a8e3fb1a..e6aa8ae1 100644 --- a/src/app/lnd/transactions/payments/lightning-payments.component.ts +++ b/src/app/lnd/transactions/payments/lightning-payments.component.ts @@ -61,7 +61,7 @@ export class LightningPaymentsComponent implements OnInit, AfterViewInit, OnDest public screenSize = ''; public screenSizeEnum = ScreenSizeEnum; public errorMessage = ''; - public apiCallStatus: ApiCallStatusPayload = null; + public apiCallStatus: ApiCallStatusPayload | null = null; public apiCallStatusEnum = APICallStatusEnum; private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()]; @@ -98,7 +98,7 @@ export class LightningPaymentsComponent implements OnInit, AfterViewInit, OnDest this.errorMessage = ''; this.apiCallStatus = paymentsSelector.apiCallStatus; if (this.apiCallStatus.status === APICallStatusEnum.ERROR) { - this.errorMessage = (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; + this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message; } this.paymentJSONArr = paymentsSelector.listPayments.payments || []; this.totalPayments = this.paymentJSONArr.length; @@ -453,7 +453,7 @@ export class LightningPaymentsComponent implements OnInit, AfterViewInit, OnDest ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/transactions/send-payment-modal/send-payment.component.spec.ts b/src/app/lnd/transactions/send-payment-modal/send-payment.component.spec.ts index 6e475246..4b1ae0b6 100644 --- a/src/app/lnd/transactions/send-payment-modal/send-payment.component.spec.ts +++ b/src/app/lnd/transactions/send-payment-modal/send-payment.component.spec.ts @@ -21,7 +21,7 @@ import { mockRTLStoreState } from '../../../shared/test-helpers/test-data'; import { RTLState } from '../../../store/rtl.state'; import { sendPayment } from '../../store/lnd.actions'; import { SelNodeChild } from '../../../shared/models/RTLconfig'; -import { Channel, SendPayment } from '../../../shared/models/lndModels'; +import { SendPayment } from '../../../shared/models/lndModels'; describe('LightningSendPaymentsComponent', () => { let component: LightningSendPaymentsComponent; @@ -61,9 +61,7 @@ describe('LightningSendPaymentsComponent', () => { it('should create', () => { storeSpyChannels = spyOn(store, 'select').and.returnValue(of(mockRTLStoreState.lnd.channels)); component.activeChannels = storeSpyChannels; - setTimeout(() => { - expect(component).toBeTruthy(); - }, 1000); + expect(component).toBeTruthy(); }); it('should get lnd store value on ngOnInit', () => { diff --git a/src/app/lnd/transactions/send-payment-modal/send-payment.component.ts b/src/app/lnd/transactions/send-payment-modal/send-payment.component.ts index 4bbcda7c..df8d6d36 100644 --- a/src/app/lnd/transactions/send-payment-modal/send-payment.component.ts +++ b/src/app/lnd/transactions/send-payment-modal/send-payment.component.ts @@ -32,14 +32,14 @@ export class LightningSendPaymentsComponent implements OnInit, OnDestroy { public selNode: SelNodeChild = {}; public paymentDecoded: PayRequest = {}; public zeroAmtInvoice = false; - public paymentAmount = null; + public paymentAmount: number | null = null; public paymentRequest = ''; public paymentDecodedHint = ''; public showAdvanced = false; - public activeChannels = []; + public activeChannels: Channel[] = []; public filteredMinAmtActvChannels: Channel[] = []; public selectedChannelCtrl = new FormControl(); - public feeLimit = null; + public feeLimit: number | null = null; public selFeeLimitType = FEE_LIMIT_TYPES[0]; public feeLimitTypes = FEE_LIMIT_TYPES; public advancedTitle = 'Advanced Options'; @@ -52,7 +52,7 @@ export class LightningSendPaymentsComponent implements OnInit, OnDestroy { this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: SelNodeChild) => { this.selNode = nodeSettings; }); this.store.select(channels).pipe(takeUntil(this.unSubs[1])). subscribe((channelsSelector: { channels: Channel[], channelsSummary: ChannelsSummary, lightningBalance: LightningBalance, apiCallStatus: ApiCallStatusPayload }) => { - this.activeChannels = channelsSelector.channels.filter((channel) => channel.active); + this.activeChannels = channelsSelector.channels && channelsSelector.channels.length ? channelsSelector.channels.filter((channel) => channel.active) : []; this.filteredMinAmtActvChannels = this.activeChannels; if (this.filteredMinAmtActvChannels.length && this.filteredMinAmtActvChannels.length > 0) { this.selectedChannelCtrl.enable(); @@ -91,7 +91,7 @@ export class LightningSendPaymentsComponent implements OnInit, OnDestroy { private filterChannels(): Channel[] { return this.activeChannels.filter((channel) => { const alias = channel.remote_alias ? channel.remote_alias.toLowerCase() : channel.chan_id ? channel.chan_id.toLowerCase() : ''; - return alias.indexOf(this.selectedChannelCtrl.value ? this.selectedChannelCtrl.value.toLowerCase() : '') === 0 && channel.local_balance >= +(this.paymentDecoded.num_satoshis ? this.paymentDecoded.num_satoshis : 0); + return alias.indexOf(this.selectedChannelCtrl.value ? this.selectedChannelCtrl.value.toLowerCase() : '') === 0 && (channel.local_balance || 0) >= +(this.paymentDecoded.num_satoshis ? this.paymentDecoded.num_satoshis : 0); }); } @@ -137,8 +137,8 @@ export class LightningSendPaymentsComponent implements OnInit, OnDestroy { } if (!this.paymentDecoded.num_satoshis || this.paymentDecoded.num_satoshis === '' || this.paymentDecoded.num_satoshis === '0') { this.zeroAmtInvoice = true; - this.paymentDecoded.num_satoshis = this.paymentAmount; - this.store.dispatch(sendPayment({ payload: { uiMessage: UI_MESSAGES.SEND_PAYMENT, paymentReq: this.paymentRequest, paymentAmount: this.paymentAmount, outgoingChannel: this.selectedChannelCtrl.value, feeLimitType: this.selFeeLimitType.id, feeLimit: this.feeLimit, fromDialog: true } })); + this.paymentDecoded.num_satoshis = this.paymentAmount?.toString() || ''; + this.store.dispatch(sendPayment({ payload: { uiMessage: UI_MESSAGES.SEND_PAYMENT, paymentReq: this.paymentRequest, paymentAmount: this.paymentAmount || 0, outgoingChannel: this.selectedChannelCtrl.value, feeLimitType: this.selFeeLimitType.id, feeLimit: this.feeLimit, fromDialog: true } })); } else { this.zeroAmtInvoice = false; this.store.dispatch(sendPayment({ payload: { uiMessage: UI_MESSAGES.SEND_PAYMENT, paymentReq: this.paymentRequest, outgoingChannel: this.selectedChannelCtrl.value, feeLimitType: this.selFeeLimitType.id, feeLimit: this.feeLimit, fromDialog: true } })); @@ -176,7 +176,7 @@ export class LightningSendPaymentsComponent implements OnInit, OnDestroy { } this.zeroAmtInvoice = false; if (this.selNode.fiatConversion) { - this.commonService.convertCurrency(+this.paymentDecoded.num_satoshis, CurrencyUnitEnum.SATS, CurrencyUnitEnum.OTHER, this.selNode.currencyUnits[2], this.selNode.fiatConversion). + this.commonService.convertCurrency(+this.paymentDecoded.num_satoshis, CurrencyUnitEnum.SATS, CurrencyUnitEnum.OTHER, (this.selNode.currencyUnits && this.selNode.currencyUnits.length > 2 ? this.selNode.currencyUnits[2] : 'BTC'), this.selNode.fiatConversion). pipe(takeUntil(this.unSubs[4])). subscribe({ next: (data) => { @@ -237,7 +237,7 @@ export class LightningSendPaymentsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/lnd/transactions/transactions.component.ts b/src/app/lnd/transactions/transactions.component.ts index 2b5d0928..24e9f1e8 100644 --- a/src/app/lnd/transactions/transactions.component.ts +++ b/src/app/lnd/transactions/transactions.component.ts @@ -55,7 +55,7 @@ export class TransactionsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/currency-unit-converter/currency-unit-converter.component.ts b/src/app/shared/components/currency-unit-converter/currency-unit-converter.component.ts index e40c984b..6207af5b 100644 --- a/src/app/shared/components/currency-unit-converter/currency-unit-converter.component.ts +++ b/src/app/shared/components/currency-unit-converter/currency-unit-converter.component.ts @@ -73,7 +73,7 @@ export class CurrencyUnitConverterComponent implements OnInit, OnChanges, OnDest ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/help/help.component.ts b/src/app/shared/components/help/help.component.ts index e8fd4dfb..1b9a936e 100644 --- a/src/app/shared/components/help/help.component.ts +++ b/src/app/shared/components/help/help.component.ts @@ -217,7 +217,7 @@ export class HelpComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/login/login.component.ts b/src/app/shared/components/login/login.component.ts index 827477dd..de9df095 100644 --- a/src/app/shared/components/login/login.component.ts +++ b/src/app/shared/components/login/login.component.ts @@ -91,7 +91,7 @@ export class LoginComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/navigation/side-navigation/side-navigation.component.ts b/src/app/shared/components/navigation/side-navigation/side-navigation.component.ts index a2147dd7..7e0e8d66 100644 --- a/src/app/shared/components/navigation/side-navigation/side-navigation.component.ts +++ b/src/app/shared/components/navigation/side-navigation/side-navigation.component.ts @@ -203,7 +203,7 @@ export class SideNavigationComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/navigation/top-menu/top-menu.component.ts b/src/app/shared/components/navigation/top-menu/top-menu.component.ts index a574d101..9148ede9 100644 --- a/src/app/shared/components/navigation/top-menu/top-menu.component.ts +++ b/src/app/shared/components/navigation/top-menu/top-menu.component.ts @@ -98,7 +98,7 @@ export class TopMenuComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/node-config/lnp-config/lnp-config.component.ts b/src/app/shared/components/node-config/lnp-config/lnp-config.component.ts index 2961c383..b688703f 100644 --- a/src/app/shared/components/node-config/lnp-config/lnp-config.component.ts +++ b/src/app/shared/components/node-config/lnp-config/lnp-config.component.ts @@ -50,7 +50,7 @@ export class LNPConfigComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/node-config/node-config.component.ts b/src/app/shared/components/node-config/node-config.component.ts index ef8e9e50..f0818bd9 100644 --- a/src/app/shared/components/node-config/node-config.component.ts +++ b/src/app/shared/components/node-config/node-config.component.ts @@ -61,7 +61,7 @@ export class NodeConfigComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/node-config/services-settings/services-settings.component.ts b/src/app/shared/components/node-config/services-settings/services-settings.component.ts index fc20c7dc..1f4869d4 100644 --- a/src/app/shared/components/node-config/services-settings/services-settings.component.ts +++ b/src/app/shared/components/node-config/services-settings/services-settings.component.ts @@ -32,7 +32,7 @@ export class ServicesSettingsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/services/boltz/boltz-root.component.ts b/src/app/shared/components/services/boltz/boltz-root.component.ts index f13c7713..824df90c 100644 --- a/src/app/shared/components/services/boltz/boltz-root.component.ts +++ b/src/app/shared/components/services/boltz/boltz-root.component.ts @@ -88,7 +88,7 @@ export class BoltzRootComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/services/boltz/swap-modal/swap-modal.component.ts b/src/app/shared/components/services/boltz/swap-modal/swap-modal.component.ts index 540695ab..8420c905 100644 --- a/src/app/shared/components/services/boltz/swap-modal/swap-modal.component.ts +++ b/src/app/shared/components/services/boltz/swap-modal/swap-modal.component.ts @@ -198,7 +198,7 @@ export class SwapModalComponent implements OnInit, AfterViewInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/services/boltz/swaps/swaps.component.ts b/src/app/shared/components/services/boltz/swaps/swaps.component.ts index ee649c6e..ecb53345 100644 --- a/src/app/shared/components/services/boltz/swaps/swaps.component.ts +++ b/src/app/shared/components/services/boltz/swaps/swaps.component.ts @@ -143,7 +143,7 @@ export class BoltzSwapsComponent implements AfterViewInit, OnChanges, OnDestroy ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/services/loop/loop-modal/loop-modal.component.ts b/src/app/shared/components/services/loop/loop-modal/loop-modal.component.ts index 714c7195..14ffa32f 100644 --- a/src/app/shared/components/services/loop/loop-modal/loop-modal.component.ts +++ b/src/app/shared/components/services/loop/loop-modal/loop-modal.component.ts @@ -293,7 +293,7 @@ export class LoopModalComponent implements OnInit, AfterViewInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/services/loop/loop.component.ts b/src/app/shared/components/services/loop/loop.component.ts index 1e5099b8..5a96d588 100644 --- a/src/app/shared/components/services/loop/loop.component.ts +++ b/src/app/shared/components/services/loop/loop.component.ts @@ -108,7 +108,7 @@ export class LoopComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/services/loop/swaps/swaps.component.ts b/src/app/shared/components/services/loop/swaps/swaps.component.ts index bb4c2190..ada5bc7c 100644 --- a/src/app/shared/components/services/loop/swaps/swaps.component.ts +++ b/src/app/shared/components/services/loop/swaps/swaps.component.ts @@ -123,7 +123,7 @@ export class SwapsComponent implements AfterViewInit, OnChanges, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/services/services.component.ts b/src/app/shared/components/services/services.component.ts index a2d269dd..5768ecef 100644 --- a/src/app/shared/components/services/services.component.ts +++ b/src/app/shared/components/services/services.component.ts @@ -67,7 +67,7 @@ export class ServicesComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/settings/bitcoin-config/bitcoin-config.component.ts b/src/app/shared/components/settings/bitcoin-config/bitcoin-config.component.ts index 083ebf04..90f0090b 100644 --- a/src/app/shared/components/settings/bitcoin-config/bitcoin-config.component.ts +++ b/src/app/shared/components/settings/bitcoin-config/bitcoin-config.component.ts @@ -50,7 +50,7 @@ export class BitcoinConfigComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/components/settings/settings.component.ts b/src/app/shared/components/settings/settings.component.ts index 7be4f2e4..af420a6b 100644 --- a/src/app/shared/components/settings/settings.component.ts +++ b/src/app/shared/components/settings/settings.component.ts @@ -50,7 +50,7 @@ export class SettingsComponent implements OnInit, OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/models/eclModels.ts b/src/app/shared/models/eclModels.ts index 5ca9ec19..16aaaa7b 100644 --- a/src/app/shared/models/eclModels.ts +++ b/src/app/shared/models/eclModels.ts @@ -246,8 +246,8 @@ export interface UpdateChannel { } export interface CloseChannel { - channelId: string; - force: boolean; + channelId?: string; + force?: boolean; } export interface GetQueryRoutes { diff --git a/src/app/shared/models/lndModels.ts b/src/app/shared/models/lndModels.ts index 39d61516..6eadd14d 100644 --- a/src/app/shared/models/lndModels.ts +++ b/src/app/shared/models/lndModels.ts @@ -434,17 +434,6 @@ export interface QueryRoutes { routes?: Route[]; } -export interface SendPayment { - dest_string?: string; - dest?: string; - payment_hash_string?: string; - payment_request?: string; - fee_limit?: FeeLimit; - amt?: number; - payment_hash?: string; - final_cltv_delta?: number; -} - export interface ChannelsTransaction { address?: string; amount?: number; @@ -552,9 +541,9 @@ export interface SendPayment { fromDialog: boolean; paymentReq: string; paymentAmount?: number; - outgoingChannel?: Channel; + outgoingChannel?: Channel | null; feeLimitType?: string; - feeLimit?: number; + feeLimit?: number | null; allowSelfPayment?: boolean; lastHopPubkey?: string; } diff --git a/src/app/shared/services/boltz.service.ts b/src/app/shared/services/boltz.service.ts index bb79693a..8f98fb3d 100644 --- a/src/app/shared/services/boltz.service.ts +++ b/src/app/shared/services/boltz.service.ts @@ -145,7 +145,7 @@ export class BoltzService implements OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/services/data.service.ts b/src/app/shared/services/data.service.ts index c4ef207b..902bfb01 100644 --- a/src/app/shared/services/data.service.ts +++ b/src/app/shared/services/data.service.ts @@ -419,7 +419,7 @@ export class DataService implements OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/services/loop.service.ts b/src/app/shared/services/loop.service.ts index 44149b07..50b5f0b6 100644 --- a/src/app/shared/services/loop.service.ts +++ b/src/app/shared/services/loop.service.ts @@ -203,7 +203,7 @@ export class LoopService implements OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); } diff --git a/src/app/shared/services/session.service.ts b/src/app/shared/services/session.service.ts index 4bf7a6ae..4995eb85 100644 --- a/src/app/shared/services/session.service.ts +++ b/src/app/shared/services/session.service.ts @@ -4,7 +4,7 @@ import { Subject, Observable } from 'rxjs'; @Injectable() export class SessionService { - private sessionSub= new Subject(); + private sessionSub = new Subject(); watchSession(): Observable { return this.sessionSub.asObservable(); diff --git a/src/app/shared/test-helpers/mock-services.ts b/src/app/shared/test-helpers/mock-services.ts index 3b3a4ff5..5bd4e952 100644 --- a/src/app/shared/test-helpers/mock-services.ts +++ b/src/app/shared/test-helpers/mock-services.ts @@ -286,7 +286,7 @@ export class mockCLEffects { invoicesFetchCL = of(() => ({})); SetChannelTransactionCL = of(() => ({})); utxosFetchCL = of(() => ({})); - setQueryRoutesCL = of(() => ({ type: CLNActions.SET_QUERY_ROUTES_CLN, payload: { routes: [] } })) + setQueryRoutesCL = of(() => ({ type: CLNActions.SET_QUERY_ROUTES_CLN, payload: { routes: [] } })); } diff --git a/src/app/store/rtl.effects.ts b/src/app/store/rtl.effects.ts index 66d60918..fcde909d 100644 --- a/src/app/store/rtl.effects.ts +++ b/src/app/store/rtl.effects.ts @@ -647,7 +647,7 @@ export class RTLEffects implements OnDestroy { ngOnDestroy() { this.unSubs.forEach((completeSub) => { - completeSub.next(null); + completeSub.next(null); completeSub.complete(); }); }