-
+
diff --git a/frontend/src/app/components/master-page/master-page.component.ts b/frontend/src/app/components/master-page/master-page.component.ts
index fc10a9e44..f3472f204 100644
--- a/frontend/src/app/components/master-page/master-page.component.ts
+++ b/frontend/src/app/components/master-page/master-page.component.ts
@@ -27,7 +27,6 @@ export class MasterPageComponent implements OnInit, OnDestroy {
subdomain = '';
networkPaths: { [network: string]: string };
networkPaths$: Observable
>;
- lightningNetworks = ['', 'mainnet', 'bitcoin', 'testnet', 'signet'];
footerVisible = true;
user: any = undefined;
servicesEnabled = false;
diff --git a/frontend/src/app/components/search-form/search-form.component.ts b/frontend/src/app/components/search-form/search-form.component.ts
index fe073564e..605dca962 100644
--- a/frontend/src/app/components/search-form/search-form.component.ts
+++ b/frontend/src/app/components/search-form/search-form.component.ts
@@ -122,7 +122,7 @@ export class SearchFormComponent implements OnInit {
]);
}
this.isTypeaheading$.next(true);
- if (!this.stateService.env.LIGHTNING) {
+ if (!this.stateService.networkSupportsLightning()) {
return zip(
this.electrsApiService.getAddressesByPrefix$(text).pipe(catchError(() => of([]))),
[{ nodes: [], channels: [] }],
diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.ts b/frontend/src/app/components/transactions-list/transactions-list.component.ts
index fc2afefc6..127f2dfe1 100644
--- a/frontend/src/app/components/transactions-list/transactions-list.component.ts
+++ b/frontend/src/app/components/transactions-list/transactions-list.component.ts
@@ -112,7 +112,7 @@ export class TransactionsListComponent implements OnInit, OnChanges {
),
this.refreshChannels$
.pipe(
- filter(() => this.stateService.env.LIGHTNING),
+ filter(() => this.stateService.networkSupportsLightning()),
switchMap((txIds) => this.apiService.getChannelByTxIds$(txIds)),
catchError((error) => {
// handle 404
@@ -248,7 +248,7 @@ export class TransactionsListComponent implements OnInit, OnChanges {
if (txIds.length && !this.cached) {
this.refreshOutspends$.next(txIds);
}
- if (this.stateService.env.LIGHTNING) {
+ if (this.stateService.networkSupportsLightning()) {
const txIds = this.transactions.filter((tx) => !tx._channels).map((tx) => tx.txid);
if (txIds.length) {
this.refreshChannels$.next(txIds);
diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts
index 742ca7ab1..fe49a0aa4 100644
--- a/frontend/src/app/services/state.service.ts
+++ b/frontend/src/app/services/state.service.ts
@@ -115,6 +115,7 @@ export class StateService {
isMempoolSpaceBuild = window['isMempoolSpaceBuild'] ?? false;
backend: 'esplora' | 'electrum' | 'none' = 'esplora';
network = '';
+ lightningNetworks = ['', 'mainnet', 'bitcoin', 'testnet', 'signet'];
lightning = false;
blockVSize: number;
env: Env;
@@ -370,6 +371,10 @@ export class StateService {
this.lightningChanged$.next(this.lightning);
}
+ networkSupportsLightning() {
+ return this.env.LIGHTNING && this.lightningNetworks.includes(this.network);
+ }
+
getHiddenProp(){
const prefixes = ['webkit', 'moz', 'ms', 'o'];
if ('hidden' in document) { return 'hidden'; }
diff --git a/frontend/src/app/shared/components/global-footer/global-footer.component.html b/frontend/src/app/shared/components/global-footer/global-footer.component.html
index 9193a8b32..ffb0e313e 100644
--- a/frontend/src/app/shared/components/global-footer/global-footer.component.html
+++ b/frontend/src/app/shared/components/global-footer/global-footer.component.html
@@ -58,7 +58,7 @@
Explore
Mining Dashboard
-
Lightning Explorer
+
Lightning Explorer
Recent Blocks
Broadcast Transaction
Test Transaction
diff --git a/frontend/src/app/shared/components/global-footer/global-footer.component.ts b/frontend/src/app/shared/components/global-footer/global-footer.component.ts
index 469a12076..7c3317acf 100644
--- a/frontend/src/app/shared/components/global-footer/global-footer.component.ts
+++ b/frontend/src/app/shared/components/global-footer/global-footer.component.ts
@@ -28,7 +28,6 @@ export class GlobalFooterComponent implements OnInit, OnDestroy {
network$: Observable
;
networkPaths: { [network: string]: string };
currentNetwork = '';
- lightningNetworks = ['', 'mainnet', 'bitcoin', 'testnet', 'signet'];
loggedIn = false;
urlSubscription: Subscription;
isServicesPage = false;