From e6dbde952eaa19685007e14261bdf44e80f872cc Mon Sep 17 00:00:00 2001 From: BitcoinMechanic Date: Mon, 23 Sep 2024 12:36:10 -0700 Subject: [PATCH] Strip non-alphanumeric chars from miner names --- .../blockchain-blocks.component.html | 13 ++----------- .../blockchain-blocks.component.ts | 1 + 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html index 79b9cea62..128d18774 100644 --- a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html +++ b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html @@ -62,17 +62,8 @@
-
- {{ block.extras.pool.minerNames[1] }} -
- - {{ block.extras.pool.name }} -
-
- - - {{ block.extras.pool.minerNames[1] }} - + + {{ block.extras.pool.minerNames[1] }}
{{ block.extras.pool.name }} diff --git a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts index 512886f23..7846b66a2 100644 --- a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts +++ b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.ts @@ -283,6 +283,7 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy { block.extras.maxFee = this.getMaxBlockFee(block); if (block.extras.pool?.minerNames) { block.extras.pool.minerNames = block.extras.pool.minerNames.map((name) => { + name = name.replace(/[^a-zA-Z0-9 ]/g, ''); if (name.length > 16) { return name.slice(0, 16) + '…'; }