From ea51c7d5f3236df9062328f9120e9f303627a461 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Fri, 25 Oct 2024 15:24:20 +0800 Subject: [PATCH] fix: G/s compatible --- app/(main)/header.tsx | 2 +- components/ServerCard.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/(main)/header.tsx b/app/(main)/header.tsx index 015a4dcea..38b5fac45 100644 --- a/app/(main)/header.tsx +++ b/app/(main)/header.tsx @@ -62,7 +62,7 @@ function Header() { // https://github.com/streamich/react-use/blob/master/src/useInterval.ts const useInterval = (callback: Function, delay?: number | null) => { - const savedCallback = useRef(() => { }); + const savedCallback = useRef(() => {}); useEffect(() => { savedCallback.current = callback; }); diff --git a/components/ServerCard.tsx b/components/ServerCard.tsx index 8772e22b4..a54b0088a 100644 --- a/components/ServerCard.tsx +++ b/components/ServerCard.tsx @@ -83,13 +83,17 @@ export default function ServerCard({

{t("Upload")}

- {up.toFixed(2)}M/s + {up >= 1024 + ? `${(up / 1024).toFixed(2)}G/s` + : `${up.toFixed(2)}M/s`}

{t("Download")}

- {down.toFixed(2)}M/s + {down >= 1024 + ? `${(down / 1024).toFixed(2)}G/s` + : `${down.toFixed(2)}M/s`}