Skip to content

Commit

Permalink
Modification roundabout d'une seule itération (#1165)
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusPele authored Nov 27, 2024
1 parent 3f4db95 commit e5e5f24
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
3 changes: 1 addition & 2 deletions src/use-lunatic/commons/page-navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ export function getNextPager(
// We reached the end of the sequence
const isEndSequence =
subPage && pager.nbSubPages ? subPage >= pager.nbSubPages : false;
const moveUpOnEnd =
parent === 'Roundabout' && pager.nbIterations && pager.nbIterations > 1;
const moveUpOnEnd = parent === 'Roundabout' && pager.nbIterations;
// Move up at the end of a sequence (instead of going to the next Iteration)
if (isEndSequence && moveUpOnEnd) {
return {
Expand Down
12 changes: 0 additions & 12 deletions src/use-lunatic/reducer/commons/auto-explore-loop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ export function autoExploreLoop(
);
}

// The page contains a roundabout, go to the first iteration if it only has one iteration
if (
page.components[0].componentType === 'Roundabout' &&
page.subPages &&
page.subPages.length > 0
) {
const nbIterations = state.executeExpression<number>(page.iterations);
if (nbIterations === 1) {
goInsideSubpage(page.subPages, 1);
}
}

// No loop were explored, don't mutate the state
if (!hasExploredLoop) {
return state;
Expand Down

0 comments on commit e5e5f24

Please sign in to comment.