From 0654872627b010db96c52e4462f3905df2b1930c Mon Sep 17 00:00:00 2001 From: natsoni Date: Mon, 27 May 2024 16:49:29 +0200 Subject: [PATCH] Fix graph legend update while load bug and remove unnecessary query --- backend/src/api/mining/mining-routes.ts | 2 -- .../block-fees-subsidy-graph.component.ts | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/api/mining/mining-routes.ts b/backend/src/api/mining/mining-routes.ts index b6ce3ba70..bdfc83d43 100644 --- a/backend/src/api/mining/mining-routes.ts +++ b/backend/src/api/mining/mining-routes.ts @@ -227,10 +227,8 @@ class MiningRoutes { throw new Error('from must be less than to'); } const blockFees = await mining.$getBlockFeesTimespan(parseInt(req.query.from as string, 10), parseInt(req.query.to as string, 10)); - const blockCount = await BlocksRepository.$blockCount(null, null); res.header('Pragma', 'public'); res.header('Cache-control', 'public'); - res.header('X-total-count', blockCount.toString()); res.setHeader('Expires', new Date(Date.now() + 1000 * 60).toUTCString()); res.json(blockFees); } catch (e) { diff --git a/frontend/src/app/components/block-fees-subsidy-graph/block-fees-subsidy-graph.component.ts b/frontend/src/app/components/block-fees-subsidy-graph/block-fees-subsidy-graph.component.ts index e858c24a1..a6fca2469 100644 --- a/frontend/src/app/components/block-fees-subsidy-graph/block-fees-subsidy-graph.component.ts +++ b/frontend/src/app/components/block-fees-subsidy-graph/block-fees-subsidy-graph.component.ts @@ -396,6 +396,10 @@ export class BlockFeesSubsidyGraphComponent implements OnInit { this.chartInstance = ec; this.chartInstance.on('legendselectchanged', (params) => { + if (this.isLoading) { + return; + } + let mode: 'normal' | 'fiat' | 'percentage'; if (params.name.includes('USD')) { mode = 'fiat';