We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab0a4bd commit e7c5670Copy full SHA for e7c5670
src/state/guards/index.ts
@@ -2,11 +2,14 @@ import * as CR from 'typings'
2
3
export default {
4
hasNextStep: (context: CR.MachineContext): boolean => {
5
- const { data, position } = context
+ const { data, position, progress } = context
6
const steps = data.stages[position.stageId].stepList
7
- const hasNext = steps[steps.length - 1] !== position.stepId
8
- console.log('GUARD: hasNextStep', hasNext)
9
- return hasNext
+ // isn't final step yet
+ if (steps[steps.length - 1] !== position.stepId) {
+ return true
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
0 commit comments