From 437350aaff352ec504053f9f333648b13cbbfff6 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Wed, 22 Feb 2023 14:06:08 +0900 Subject: [PATCH 1/2] Unknown pool color #FDD835 --- frontend/src/app/app.constants.ts | 2 +- .../hashrates-chart-pools/hashrate-chart-pools.component.ts | 2 +- .../src/app/components/pool-ranking/pool-ranking.component.ts | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/app.constants.ts b/frontend/src/app/app.constants.ts index 8a954166e..779eab62e 100644 --- a/frontend/src/app/app.constants.ts +++ b/frontend/src/app/app.constants.ts @@ -72,7 +72,7 @@ export const chartColors = [ ]; export const poolsColor = { - 'unknown': '#9C9C9C', + 'unknown': '#FDD835', }; export const feeLevels = [1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 30, 40, 50, 60, 70, 80, 90, 100, 125, 150, 175, 200, diff --git a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts index df7780fee..e7e3685d3 100644 --- a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts +++ b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts @@ -173,7 +173,7 @@ export class HashrateChartPoolsComponent implements OnInit { this.chartOptions = { title: title, animation: false, - color: chartColors, + color: chartColors.filter(color => color !== '#FDD835'), grid: { right: this.right, left: this.left, diff --git a/frontend/src/app/components/pool-ranking/pool-ranking.component.ts b/frontend/src/app/components/pool-ranking/pool-ranking.component.ts index 8284d81da..a3f23c031 100644 --- a/frontend/src/app/components/pool-ranking/pool-ranking.component.ts +++ b/frontend/src/app/components/pool-ranking/pool-ranking.component.ts @@ -4,7 +4,6 @@ import { ActivatedRoute, Router } from '@angular/router'; import { EChartsOption, PieSeriesOption } from 'echarts'; import { concat, Observable } from 'rxjs'; import { map, share, startWith, switchMap, tap } from 'rxjs/operators'; -import { SinglePoolStats } from '../../interfaces/node-api.interface'; import { SeoService } from '../../services/seo.service'; import { StorageService } from '../..//services/storage.service'; import { MiningService, MiningStats } from '../../services/mining.service'; @@ -220,7 +219,7 @@ export class PoolRankingComponent implements OnInit { this.chartOptions = { animation: false, - color: chartColors, + color: chartColors.filter(color => color !== '#FDD835'), tooltip: { trigger: 'item', textStyle: { From 2246a6f3cefba9f789f9192d533a29afab8d5bba Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Wed, 22 Feb 2023 20:42:32 +0900 Subject: [PATCH 2/2] Fix 'NaN' price for unconfirmed transaction since we have no block timestamp --- frontend/src/app/services/price.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/app/services/price.service.ts b/frontend/src/app/services/price.service.ts index 3320280e9..fe6d67bb6 100644 --- a/frontend/src/app/services/price.service.ts +++ b/frontend/src/app/services/price.service.ts @@ -93,6 +93,10 @@ export class PriceService { * @param blockTimestamp */ getPriceForTimestamp(blockTimestamp: number): Price | null { + if (!blockTimestamp) { + return undefined; + } + const priceTimestamps = Object.keys(this.historicalPrice.prices); priceTimestamps.push(Number.MAX_SAFE_INTEGER.toString()); priceTimestamps.sort().reverse();