Remove all lightning elements on unsupported networks

This commit is contained in:
Mononaut
2024-05-12 16:44:07 +00:00
parent db34ca6a5f
commit 788caf05ce
8 changed files with 11 additions and 8 deletions

View File

@@ -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'; }