Enhance StateDisplay component to improve progress calculation
- Introduced a new progressValue calculation to round the currentState.progress for better precision in the displayed progress percentage. - Updated the Progress component to utilize the new progressValue, ensuring accurate representation of loading progress.
This commit is contained in:
parent
4d9db747a2
commit
2a849cea57
@ -29,6 +29,7 @@ const StateDisplay = ({
|
|||||||
progress: 0
|
progress: 0
|
||||||
}
|
}
|
||||||
const [showMessageModal, setShowMessageModal] = useState(false)
|
const [showMessageModal, setShowMessageModal] = useState(false)
|
||||||
|
const progressValue = Math.round(currentState.progress * 1000) / 10
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Flex gap='small' align={'center'}>
|
<Flex gap='small' align={'center'}>
|
||||||
@ -40,9 +41,10 @@ const StateDisplay = ({
|
|||||||
{showProgress &&
|
{showProgress &&
|
||||||
loadingProgressTypes.includes(currentState.type) &&
|
loadingProgressTypes.includes(currentState.type) &&
|
||||||
currentState?.progress &&
|
currentState?.progress &&
|
||||||
|
progressValue !== 100 &&
|
||||||
currentState?.progress > 0 ? (
|
currentState?.progress > 0 ? (
|
||||||
<Progress
|
<Progress
|
||||||
percent={Math.round(currentState.progress * 100)}
|
percent={progressValue}
|
||||||
status={
|
status={
|
||||||
activeProgressTypes.includes(currentState.type) ? 'active' : ''
|
activeProgressTypes.includes(currentState.type) ? 'active' : ''
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user