From fd7c7ef9545cd73360b35b4921978ad8d8e52dc4 Mon Sep 17 00:00:00 2001 From: Andrew Davis <1709934+Savid@users.noreply.github.com> Date: Wed, 6 Nov 2024 18:35:07 +1000 Subject: [PATCH] fix(web): handle epoch as string --- web/src/parts/checkpoints/Checkpoints.tsx | 2 +- web/src/parts/checkpoints/CheckpointsTable.tsx | 2 +- web/src/types/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/parts/checkpoints/Checkpoints.tsx b/web/src/parts/checkpoints/Checkpoints.tsx index 72a5ccc..9da8e60 100644 --- a/web/src/parts/checkpoints/Checkpoints.tsx +++ b/web/src/parts/checkpoints/Checkpoints.tsx @@ -24,7 +24,7 @@ export default function Checkpoints() { const latestEpoch = useMemo(() => { const finalizedEpoch = statusData?.data?.finality?.finalized?.epoch; if (!finalizedEpoch) return; - return parseInt(finalizedEpoch); + return finalizedEpoch; }, [statusData]); if (isLoading) diff --git a/web/src/parts/checkpoints/CheckpointsTable.tsx b/web/src/parts/checkpoints/CheckpointsTable.tsx index de3da99..f734815 100644 --- a/web/src/parts/checkpoints/CheckpointsTable.tsx +++ b/web/src/parts/checkpoints/CheckpointsTable.tsx @@ -10,7 +10,7 @@ import { APIBeaconSlot } from '@types'; import { truncateHash } from '@utils'; export default function CheckpointsTable(props: { - latestEpoch?: number; + latestEpoch?: string; slots: APIBeaconSlot[]; onSlotClick?: (slot: APIBeaconSlot) => void; showCheckpoint?: boolean; diff --git a/web/src/types/index.ts b/web/src/types/index.ts index e249057..44d4561 100644 --- a/web/src/types/index.ts +++ b/web/src/types/index.ts @@ -42,7 +42,7 @@ export interface APIBeaconSlot { slot: number; block_root?: string; state_root?: string; - epoch?: number; + epoch?: string; time?: APISlotTime; }