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:
Tom Butcher 2026-07-26 18:37:24 +01:00
parent 4d9db747a2
commit 2a849cea57

View File

@ -29,6 +29,7 @@ const StateDisplay = ({
progress: 0
}
const [showMessageModal, setShowMessageModal] = useState(false)
const progressValue = Math.round(currentState.progress * 1000) / 10
return (
<>
<Flex gap='small' align={'center'}>
@ -40,9 +41,10 @@ const StateDisplay = ({
{showProgress &&
loadingProgressTypes.includes(currentState.type) &&
currentState?.progress &&
progressValue !== 100 &&
currentState?.progress > 0 ? (
<Progress
percent={Math.round(currentState.progress * 100)}
percent={progressValue}
status={
activeProgressTypes.includes(currentState.type) ? 'active' : ''
}