소스 검색

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

Joel 1 년 전
부모
커밋
5bcbcd3c57
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      web/app/components/datasets/documents/detail/completed/SegmentCard.tsx

+ 1 - 1
web/app/components/datasets/documents/detail/completed/SegmentCard.tsx

@@ -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>