We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentab0a4bd commite7c5670Copy full SHA for e7c5670
src/state/guards/index.ts
@@ -2,11 +2,14 @@ import * as CR from 'typings'
2
3
exportdefault{
4
hasNextStep:(context:CR.MachineContext):boolean=>{
5
-const{ data, position}=context
+const{ data, position, progress}=context
6
conststeps=data.stages[position.stageId].stepList
7
-consthasNext=steps[steps.length-1]!==position.stepId
8
-console.log('GUARD: hasNextStep',hasNext)
9
-returnhasNext
+// isn't final step yet
+if(steps[steps.length-1]!==position.stepId){
+returntrue
10
+}
11
+// final step is not yet complete
12
+return!progress.steps[position.stepId]
13
},
14
hasNextStage:(context:CR.MachineContext):boolean=>{
15
const{ data, position}=context