From 68f3022420101bec78c4378c8ed73575ea380d99 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Wed, 30 Mar 2022 22:18:03 +0900 Subject: [PATCH] Don't use `slugs` if it's not available in pools.json frontend --- frontend/src/app/components/miner/miner.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/miner/miner.component.ts b/frontend/src/app/components/miner/miner.component.ts index babda3dad..dd3bc86d4 100644 --- a/frontend/src/app/components/miner/miner.component.ts +++ b/frontend/src/app/components/miner/miner.component.ts @@ -46,7 +46,7 @@ export class MinerComponent implements OnChanges { this.miner = pools.payout_addresses[vout.scriptpubkey_address].name; this.title = $localize`:@@miner-identified-by-payout:Identified by payout address: '${vout.scriptpubkey_address}:PAYOUT_ADDRESS:'`; const pool = pools.payout_addresses[vout.scriptpubkey_address]; - if (this.stateService.env.MINING_DASHBOARD && pools.slugs[pool.name] !== undefined) { + if (this.stateService.env.MINING_DASHBOARD && pools.slugs && pools.slugs[pool.name] !== undefined) { this.url = this.relativeUrlPipe.transform(`/mining/pool/${pools.slugs[pool.name]}`); this.target = ''; } else { @@ -62,7 +62,7 @@ export class MinerComponent implements OnChanges { const pool = pools.coinbase_tags[tag]; this.miner = pool.name; this.title = $localize`:@@miner-identified-by-coinbase:Identified by coinbase tag: '${tag}:TAG:'`; - if (this.stateService.env.MINING_DASHBOARD && pools.slugs[pool.name] !== undefined) { + if (this.stateService.env.MINING_DASHBOARD && pools.slugs && pools.slugs[pool.name] !== undefined) { this.url = this.relativeUrlPipe.transform(`/mining/pool/${pools.slugs[pool.name]}`); this.target = ''; } else {