From 1192664a26c943ad6e27a89747952d0b53495e1a Mon Sep 17 00:00:00 2001 From: s6pa1rta3n-lab Date: Tue, 1 Sep 2026 20:09:10 -0400 Subject: [PATCH] refactor(web): reuse the shared address formatter in the round hook (#258) --- apps/web/src/hooks/useRoundSession.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/web/src/hooks/useRoundSession.ts b/apps/web/src/hooks/useRoundSession.ts index 84bb2d9..5c981e0 100644 --- a/apps/web/src/hooks/useRoundSession.ts +++ b/apps/web/src/hooks/useRoundSession.ts @@ -37,6 +37,7 @@ import { DEMO_TRACE } from "../demo/trace"; import { formatCountdown, useDrandCountdown } from "./useDrandCountdown"; import { useToast } from "../ui/Toast"; import { useTime } from "../lib/time"; +import { shortAddr } from "../lib/format"; export type ActionStatus = "idle" | "working" | "ok" | "error"; @@ -469,8 +470,3 @@ export function useRoundSession(active: UseCase) { refresh, }; } - -function shortAddr(addr: string, len = 6) { - if (addr.length <= len * 2 + 3) return addr; - return `${addr.slice(0, len)}…${addr.slice(-len)}`; -}