Skip to content

Commit

Permalink
fix: G/s compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Oct 25, 2024
1 parent d41db00 commit ea51c7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/(main)/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Function>(() => { });
const savedCallback = useRef<Function>(() => {});
useEffect(() => {
savedCallback.current = callback;
});
Expand Down
8 changes: 6 additions & 2 deletions components/ServerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,17 @@ export default function ServerCard({
<div className={"flex w-14 flex-col"}>
<p className="text-xs text-muted-foreground">{t("Upload")}</p>
<div className="flex items-center text-xs font-semibold">
{up.toFixed(2)}M/s
{up >= 1024
? `${(up / 1024).toFixed(2)}G/s`
: `${up.toFixed(2)}M/s`}
</div>
</div>
<div className={"flex w-14 flex-col"}>
<p className="text-xs text-muted-foreground">{t("Download")}</p>
<div className="flex items-center text-xs font-semibold">
{down.toFixed(2)}M/s
{down >= 1024
? `${(down / 1024).toFixed(2)}G/s`
: `${down.toFixed(2)}M/s`}
</div>
</div>
</section>
Expand Down

0 comments on commit ea51c7d

Please sign in to comment.