From bd68f62fa5fa3161c3439a3ab967298167299c0b Mon Sep 17 00:00:00 2001 From: isstuev Date: Thu, 4 Jan 2024 16:32:17 +0100 Subject: [PATCH] null gas prices --- types/api/stats.ts | 6 +++--- ui/home/Stats.tsx | 2 +- ui/shared/GasInfoTooltipContent/GasInfoTooltipContent.tsx | 6 +++--- ui/snippets/topBar/TopBarStats.tsx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/types/api/stats.ts b/types/api/stats.ts index d67a53211d..7ce179368f 100644 --- a/types/api/stats.ts +++ b/types/api/stats.ts @@ -16,9 +16,9 @@ export type HomeStats = { } export type GasPrices = { - average: number; - fast: number; - slow: number; + average: number | null; + fast: number | null; + slow: number | null; } export type Counters = { diff --git a/ui/home/Stats.tsx b/ui/home/Stats.tsx index 41714197b6..3e0b2edbcf 100644 --- a/ui/home/Stats.tsx +++ b/ui/home/Stats.tsx @@ -92,7 +92,7 @@ const Stats = () => { { return ( Slow - { `${ gasPrices.slow } Gwei` } + { gasPrices.slow !== null ? `${ gasPrices.slow } Gwei` : 'N/A' } Average - { `${ gasPrices.average } Gwei` } + { gasPrices.average !== null ? `${ gasPrices.average } Gwei` : 'N/A' } Fast - { `${ gasPrices.fast } Gwei` } + { gasPrices.fast !== null ? `${ gasPrices.fast } Gwei` : 'N/A' } ); }; diff --git a/ui/snippets/topBar/TopBarStats.tsx b/ui/snippets/topBar/TopBarStats.tsx index 31ab9a2a33..758bcfb1a6 100644 --- a/ui/snippets/topBar/TopBarStats.tsx +++ b/ui/snippets/topBar/TopBarStats.tsx @@ -40,7 +40,7 @@ const TopBarStats = () => { ) } { data?.coin_price && config.UI.homepage.showGasTracker && } - { data?.gas_prices && config.UI.homepage.showGasTracker && ( + { data?.gas_prices && data.gas_prices.average !== null && config.UI.homepage.showGasTracker && ( Gas