diff --git a/src/components/exec-bench-table.tsx b/src/components/exec-bench-table.tsx index ad181f2c..cb347233 100644 --- a/src/components/exec-bench-table.tsx +++ b/src/components/exec-bench-table.tsx @@ -4,6 +4,7 @@ import { useState } from "react"; import type { ExecLeaderboardResponse } from "@/lib/solana-exec"; import { PLATFORM_DISPLAY, lamportsToSOL, fmtCUPrice } from "@/lib/solana-exec"; +const NOW_MS = Date.now(); const WINDOWS = ["24h", "7d", "30d"] as const; type Window = (typeof WINDOWS)[number]; @@ -28,10 +29,9 @@ export function ExecBenchTable({ data: ExecLeaderboardResponse | null; }) { const [win, setWin] = useState("24h"); - // eslint-disable-next-line react-compiler/react-compiler const stale = data?.updatedAt - ? Date.now() - new Date(data.updatedAt).getTime() > 3 * 60 * 60 * 1000 + ? NOW_MS - new Date(data.updatedAt).getTime() > 3 * 60 * 60 * 1000 : false; if (!data) { diff --git a/src/components/trading-apps-leaderboard.tsx b/src/components/trading-apps-leaderboard.tsx index 5bf71d6e..1cba0e83 100644 --- a/src/components/trading-apps-leaderboard.tsx +++ b/src/components/trading-apps-leaderboard.tsx @@ -7,6 +7,8 @@ import { logoPath } from "@/lib/logo-manifest"; import type { AppMeta } from "@/lib/trading-apps-config"; import type { DLPlatformData } from "@/lib/defillama"; +const NOW_MS = Date.now(); + type FeeWindow = { solana: number | null; ethereum: number | null; @@ -356,9 +358,8 @@ export function TradingAppsLeaderboard({ } function FOMODataNotice({ latestDate }: { latestDate: string | null }) { - // eslint-disable-next-line react-compiler/react-compiler const ageHours = latestDate - ? (Date.now() - new Date(latestDate).getTime()) / 3_600_000 + ? (NOW_MS - new Date(latestDate).getTime()) / 3_600_000 : 0; if (!latestDate || ageHours <= 36) return null; return (