🐛 (analytics) Fix previous total computation max call stack exceeded

Closes #624
This commit is contained in:
Baptiste Arnaud
2023-07-25 17:29:06 +02:00
parent 4607f0ea39
commit 7a7d471805
3 changed files with 5 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ export const computePreviousTotalAnswers = (
const currentBlockIndex = currentGroup.blocks.findIndex(
(block) => block.id === currentBlockId
)
const previousBlocks = currentGroup.blocks.slice(0, currentBlockIndex)
const previousBlocks = currentGroup.blocks.slice(0, currentBlockIndex + 1)
for (const block of previousBlocks.reverse()) {
if (isInputBlock(block) || block.type === 'start')
return (