fix: retrieval value greater more than 1 caused ui problem (#4718)

This commit is contained in:
Joel 2024-05-28 16:01:19 +08:00 committed by GitHub
parent 1b2d862973
commit 5bcbcd3c57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,7 @@ const ProgressBar: FC<{ percent: number; loading: boolean }> = ({ percent, loadi
<div className={cn(s.progress, loading ? s.progressLoading : '')}>
<div
className={s.progressInner}
style={{ width: `${loading ? 0 : (percent * 100).toFixed(2)}%` }}
style={{ width: `${loading ? 0 : (Math.min(percent, 1) * 100).toFixed(2)}%` }}
/>
</div>
<div className={loading ? s.progressTextLoading : s.progressText}>{loading ? null : percent.toFixed(2)}</div>