Fix gas tracker time when backend returns 0 (#1819)

Fixes #1818
This commit is contained in:
tom goriunov
2024-04-16 10:28:01 +02:00
committed by GitHub
parent b6d5268188
commit 893d0a0e30
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ const GasTrackerPriceSnippet = ({ data, type, isLoading }: Props) => {
<Skeleton isLoaded={ !isLoading } fontSize="sm" color="text_secondary" mt={ 3 } w="fit-content">
{ data.price && data.fiat_price && <GasPrice data={ data } prefix={ `${ asymp } ` } unitMode="secondary"/> }
<span> per transaction</span>
{ data.time && <span> / { (data.time / SECOND).toLocaleString(undefined, { maximumFractionDigits: 1 }) }s</span> }
{ typeof data.time === 'number' && data.time > 0 && <span> / { (data.time / SECOND).toLocaleString(undefined, { maximumFractionDigits: 1 }) }s</span> }
</Skeleton>
<Skeleton isLoaded={ !isLoading } fontSize="sm" color="text_secondary" mt={ 2 } w="fit-content" whiteSpace="pre">
{ data.base_fee && <span>Base { data.base_fee.toLocaleString(undefined, { maximumFractionDigits: 0 }) }</span> }
+1 -1
View File
@@ -16,7 +16,7 @@ const GasInfoTooltipRow = ({ name, info }: Props) => {
<>
<Box>
<chakra.span>{ name }</chakra.span>
{ info && info.time && (
{ info && typeof info.time === 'number' && info.time > 0 && (
<chakra.span color="text_secondary">
{ space }{ (info.time / 1000).toLocaleString(undefined, { maximumFractionDigits: 1 }) }s
</chakra.span>