From 8d8c2ed2625185ca93c873c49bd1ff4a0a7c6747 Mon Sep 17 00:00:00 2001 From: dongchengjie <37543964+dongchengjie@users.noreply.github.com> Date: Wed, 3 Jul 2024 02:57:03 +0800 Subject: [PATCH] fix: sub usage percent fails to display when number is too small #1290 --- src/components/profile/profile-item.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/profile/profile-item.tsx b/src/components/profile/profile-item.tsx index 0ecaed6..42ff0f4 100644 --- a/src/components/profile/profile-item.tsx +++ b/src/components/profile/profile-item.tsx @@ -71,7 +71,7 @@ export const ProfileItem = (props: Props) => { const from = parseUrl(itemData.url); const description = itemData.desc; const expire = parseExpire(extra?.expire); - const progress = Math.round(((download + upload) * 100) / (total + 0.1)); + const progress = Math.round(((download + upload) * 100) / (total + 0.01) + 1); const loading = loadingCache[itemData.uid] ?? false; @@ -429,7 +429,7 @@ export const ProfileItem = (props: Props) => { 0 ? 1 : 0 }} + style={{ opacity: total > 0 ? 1 : 0 }} />