Merge branch 'main' into opencode/lucky-comet

This commit is contained in:
sagit
2026-02-11 10:26:30 +08:00
committed by GitHub
+6 -2
View File
@@ -275,9 +275,13 @@ export default function PanelSharingPage() {
const formatFlowGB = (bytes: number) => {
if (!Number.isFinite(bytes) || bytes <= 0) {
return "0.00 GB";
return "0 B";
}
return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
if (bytes < 1024) return bytes + " B";
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(2) + " KB";
if (bytes < 1024 * 1024 * 1024)
return (bytes / (1024 * 1024)).toFixed(2) + " MB";
return (bytes / (1024 * 1024 * 1024)).toFixed(2) + " GB";
};
const formatChainType = (chainType: number, hopInx: number) => {