Skip to content

Commit e5e5f24

Browse files
authored
Modification roundabout d'une seule itération (#1165)
1 parent 3f4db95 commit e5e5f24

2 files changed

Lines changed: 1 addition & 14 deletions

File tree

src/use-lunatic/commons/page-navigation.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ export function getNextPager(
3030
// We reached the end of the sequence
3131
const isEndSequence =
3232
subPage && pager.nbSubPages ? subPage >= pager.nbSubPages : false;
33-
const moveUpOnEnd =
34-
parent === 'Roundabout' && pager.nbIterations && pager.nbIterations > 1;
33+
const moveUpOnEnd = parent === 'Roundabout' && pager.nbIterations;
3534
// Move up at the end of a sequence (instead of going to the next Iteration)
3635
if (isEndSequence && moveUpOnEnd) {
3736
return {

src/use-lunatic/reducer/commons/auto-explore-loop.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ export function autoExploreLoop(
3737
);
3838
}
3939

40-
// The page contains a roundabout, go to the first iteration if it only has one iteration
41-
if (
42-
page.components[0].componentType === 'Roundabout' &&
43-
page.subPages &&
44-
page.subPages.length > 0
45-
) {
46-
const nbIterations = state.executeExpression<number>(page.iterations);
47-
if (nbIterations === 1) {
48-
goInsideSubpage(page.subPages, 1);
49-
}
50-
}
51-
5240
// No loop were explored, don't mutate the state
5341
if (!hasExploredLoop) {
5442
return state;

0 commit comments

Comments
 (0)