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] 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();