@@ -33,28 +33,28 @@ class Position {
3333
3434 const { levels} = tutorial . version
3535
36- const lastLevelIndex : number | undefined = levels . findIndex ( ( l : G . Level ) => progress . levels [ l . id ] )
36+ const lastLevelIndex : number | undefined = levels . findIndex ( ( l : G . Level ) => ! progress . levels [ l . id ] )
3737 // TODO: consider all levels complete as progress.complete
3838 if ( lastLevelIndex >= levels . length ) {
3939 throw new Error ( 'Error setting progress level' )
4040 }
41- const currentLevel : G . Level = levels [ lastLevelIndex + 1 ]
41+ const currentLevel : G . Level = levels [ lastLevelIndex ]
4242
4343 const { stages} = currentLevel
4444
45- const lastStageIndex : number | undefined = stages . findIndex ( ( s : G . Stage ) => progress . stages [ s . id ] )
45+ const lastStageIndex : number | undefined = stages . findIndex ( ( s : G . Stage ) => ! progress . stages [ s . id ] )
4646 if ( lastStageIndex >= stages . length ) {
4747 throw new Error ( 'Error setting progress stage' )
4848 }
49- const currentStage : G . Stage = stages [ lastStageIndex + 1 ]
49+ const currentStage : G . Stage = stages [ lastStageIndex ]
5050
5151 const { steps} = currentStage
5252
53- const lastStepIndex : number | undefined = steps . findIndex ( ( s : G . Step ) => progress . steps [ s . id ] )
53+ const lastStepIndex : number | undefined = steps . findIndex ( ( s : G . Step ) => ! progress . steps [ s . id ] )
5454 if ( lastStepIndex >= steps . length ) {
5555 throw new Error ( 'Error setting progress step' )
5656 }
57- const currentStep : G . Step = steps [ lastStepIndex + 1 ]
57+ const currentStep : G . Step = steps [ lastStepIndex ]
5858
5959 this . value = {
6060 levelId : currentLevel . id ,
0 commit comments