diff --git a/landing/src/components/LiveStats.vue b/landing/src/components/LiveStats.vue index 6807e37..f72f949 100644 --- a/landing/src/components/LiveStats.vue +++ b/landing/src/components/LiveStats.vue @@ -221,7 +221,12 @@ async function fetchEthPrice() { const now = Date.now(); if (ethUsdPrice.value !== null && (now - ethPriceCacheTime) < ETH_PRICE_CACHE_MS) return; try { - const resp = await fetch('https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd'); + const controller = new AbortController(); + const timeout = setTimeout(() => controller.abort(), 5000); + const resp = await fetch('https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd', { + signal: controller.signal, + }); + clearTimeout(timeout); if (!resp.ok) throw new Error('ETH price fetch failed'); const data = await resp.json(); if (data.ethereum?.usd) { @@ -359,7 +364,7 @@ const floorPriceAmount = computed(() => { }); const floorPriceDisplay = computed(() => { - if (floorPriceAmount.value == null) return null; + if (floorPriceAmount.value == null) return '—'; const eth = floorPriceAmount.value; if (ethUsdPrice.value) return formatUsd(eth * ethUsdPrice.value); return formatSmallEth(eth);