From 6937e1a13cb5970741a61f6533f1b2e711d89c85 Mon Sep 17 00:00:00 2001 From: JackEnx Date: Thu, 18 Apr 2024 21:11:34 -0300 Subject: [PATCH] fix: game download information --- src/renderer/utils/format-bytes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/utils/format-bytes.ts b/src/renderer/utils/format-bytes.ts index 5aa39072..b052b43b 100644 --- a/src/renderer/utils/format-bytes.ts +++ b/src/renderer/utils/format-bytes.ts @@ -1,8 +1,8 @@ const FORMAT = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; export const formatBytes = (bytes: number): string => { - if (!Number.isFinite(bytes) || isNaN(bytes) || bytes < 0) { - return `N/A ${FORMAT[0]}`; + if (!Number.isFinite(bytes) || isNaN(bytes) || bytes <= 0) { + return `0 ${FORMAT[0]}`; } const byteKBase = 1024;