Skip to content

Fix/continue #301

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 5 commits into from
Apr 27, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
check tutorial.id locally
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
ShMcK committed Apr 26, 2020
commit cc0d6426fcf9fdd3c41966b1aa524ac7ee6034d7
30 changes: 14 additions & 16 deletions src/channel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,22 @@ class Channel implements Channel {
// continue from tutorial from local storage
const tutorial: TT.Tutorial | null = this.context.tutorial.get()

// new tutorial
this.send({ type: 'START_NEW_TUTORIAL', payload: { env } })
return

// disable continue until fixed

// // set tutorial
// const { position, progress } = await this.context.setTutorial(this.workspaceState, tutorial)
// no stored tutorial, must start new tutorial
if (!tutorial || !tutorial.id) {
this.send({ type: 'START_NEW_TUTORIAL', payload: { env } })
return
}

// if (progress.complete) {
// // tutorial is already complete
// this.send({ type: 'TUTORIAL_ALREADY_COMPLETE', payload: { env } })
// return
// }
// // communicate to client the tutorial & stepProgress state
// this.send({ type: 'LOAD_STORED_TUTORIAL', payload: { env, tutorial, progress, position } })
// load continued tutorial position & progress
const { position, progress } = await this.context.setTutorial(this.workspaceState, tutorial)

// return
if (progress.complete) {
// tutorial is already complete
this.send({ type: 'TUTORIAL_ALREADY_COMPLETE', payload: { env } })
return
}
// communicate to client the tutorial & stepProgress state
this.send({ type: 'LOAD_STORED_TUTORIAL', payload: { env, tutorial, progress, position } })
} catch (e) {
const error = {
type: 'UnknownError',
Expand Down