Skip to content
Prev Previous commit
Next Next commit
remove unused states
Signed-off-by: shmck <[email protected]>
  • Loading branch information
ShMcK committed Aug 1, 2020
commit bd96f17c23a1ce6a7b7e7eb68475e46ffdd70b45
2 changes: 0 additions & 2 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ export interface MachineStateSchema {
Load: {}
Normal: {}
TestRunning: {}
TestPass: {}
TestFail: {}
StepNext: {}
LevelComplete: {}
LoadNext: {}
Expand Down
2 changes: 1 addition & 1 deletion web-app/src/containers/Tutorial/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const styles = {
interface PageProps {
context: T.MachineContext
send(action: T.Action): void
state: string // 'Normal' | 'TestRunning' | 'TestFail' | 'TestPass' | 'Level.LevelComplete'
state: string // 'Normal' | 'TestRunning' | 'Level.LevelComplete'
}

/**
Expand Down
19 changes: 4 additions & 15 deletions web-app/src/services/state/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,30 +180,19 @@ export const createMachine = (options: any) => {
onEntry: ['testStart'],
on: {
TEST_PASS: {
target: 'TestPass',
actions: ['testPass'],
target: 'StepNext',
actions: ['testPass', 'updateStepPosition'],
},
TEST_FAIL: {
target: 'TestFail',
target: 'Normal',
actions: ['testFail'],
},
TEST_ERROR: {
target: 'TestFail',
target: 'Normal',
actions: ['testFail'],
},
},
},
TestPass: {
onExit: ['updateStepPosition'],
after: {
0: 'StepNext',
},
},
TestFail: {
after: {
0: 'Normal',
},
},
StepNext: {
onEntry: ['stepNext'],
on: {
Expand Down