Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/exec-bench-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -28,10 +29,9 @@ export function ExecBenchTable({
data: ExecLeaderboardResponse | null;
}) {
const [win, setWin] = useState<Window>("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) {
Expand Down
5 changes: 3 additions & 2 deletions src/components/trading-apps-leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 (
Expand Down
Loading