Skip to content

Commit

Permalink
fix: Enlève la comparaison avec current qui était une fonction défi…
Browse files Browse the repository at this point in the history
…nie au dessus (#3987)
  • Loading branch information
baptou12 authored Sep 20, 2023
1 parent 5622ff9 commit ec69301
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export function getNextStep(
currentRoute: Route,
journey: StepStrict[]
): StepStrict {
const currentPath = currentRoute.path || currentRoute.fullPath
const matches = journey
.map((element, index) => {
return { element, index }
})
.filter((item) => item.element.path == (currentRoute.path || current))
.filter((item) => item.element.path == currentPath)

if (!matches.length) {
const test = currentRoute.path || currentRoute.fullPath || current
throw new Error(`Logic missing for ${test}`)
throw new Error(`Logic missing for ${currentPath}`)
}
return journey
.slice(matches[matches.length - 1].index + 1)
Expand Down

0 comments on commit ec69301

Please sign in to comment.