2
0

💄 Improve progress bar UI and make avoid starting at 0

This commit is contained in:
Baptiste Arnaud
2024-02-27 14:22:46 +01:00
parent 0b193101b9
commit 229453d3d3
12 changed files with 86 additions and 61 deletions

View File

@ -13,7 +13,6 @@ export const computeCurrentProgress = ({
progressMetadata,
currentInputBlockId,
}: Props) => {
if (progressMetadata.totalAnswers === 0) return 0
const paths = computePossibleNextInputBlocks({
typebotsQueue: typebotsQueue,
blockId: currentInputBlockId,
@ -22,11 +21,10 @@ export const computeCurrentProgress = ({
},
currentPath: [],
})
return (
(progressMetadata.totalAnswers /
((progressMetadata.totalAnswers + 1) /
(Math.max(...paths.map((b) => b.length)) +
progressMetadata.totalAnswers)) *
(progressMetadata.totalAnswers + 1))) *
100
)
}