diff --git a/src/components/profile/profile-item.tsx b/src/components/profile/profile-item.tsx index 081f9d9b..ecaadff0 100644 --- a/src/components/profile/profile-item.tsx +++ b/src/components/profile/profile-item.tsx @@ -73,7 +73,10 @@ 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.01) + 1); + const progress = Math.min( + Math.round(((download + upload) * 100) / (total + 0.01)) + 1, + 100 + ); const loading = loadingCache[itemData.uid] ?? false; diff --git a/src/components/proxy/provider-button.tsx b/src/components/proxy/provider-button.tsx index 1962e29a..ca81a428 100644 --- a/src/components/proxy/provider-button.tsx +++ b/src/components/proxy/provider-button.tsx @@ -105,8 +105,9 @@ export const ProviderButton = () => { const download = sub?.Download || 0; const total = sub?.Total || 0; const expire = sub?.Expire || 0; - const progress = Math.round( - ((download + upload) * 100) / (total + 0.1) + const progress = Math.min( + Math.round(((download + upload) * 100) / (total + 0.01)) + 1, + 100 ); return ( <> @@ -159,6 +160,7 @@ export const ProviderButton = () => { 0 ? 1 : 0 }} /> )}