Skip to content

Fix/update to api #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Oct 15, 2019
Prev Previous commit
fix updating level
  • Loading branch information
ShMcK committed Oct 15, 2019
commit a79211399933448e96227836cc108829cd94435e
13 changes: 13 additions & 0 deletions web-app/src/services/state/actions/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ export default {
},
}),
// @ts-ignore
updateLevelProgress: assign({
progress: (context: CR.MachineContext, event: CR.MachineEvent): CR.Progress => {
// update progress by tracking completed
const {progress, position} = context

const levelId: string = position.levelId

progress.levels[levelId] = true

return progress
},
}),
// @ts-ignore
updateStepProgress: assign({
progress: (context: CR.MachineContext, event: CR.MachineEvent): CR.Progress => {
// update progress by tracking completed
Expand Down