Skip to content

Fix/continue #63

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 4 commits into from
Dec 1, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix currentStepId on continue load
  • Loading branch information
ShMcK committed Dec 1, 2019
commit 6eddbb75b2cf83157faeb50bb2536b8f43a80521
4 changes: 3 additions & 1 deletion src/channel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ class Channel implements Channel {
},
onError,
)
// update the current stepId on startup
vscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP, action.payload)
return
// load step actions (git commits, commands, open files)
case 'SETUP_ACTIONS':
vscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP, action.payload)
await vscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP, action.payload)
setupActions(this.workspaceRoot, action.payload, this.send)
return
// load solution step actions (git commits, commands, open files)
Expand Down
2 changes: 1 addition & 1 deletion src/editor/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const createCommands = ({ extensionPath, workspaceState, workspaceRoot }:
},
[COMMANDS.RUN_TEST]: (current: Payload | undefined, onSuccess: () => void) => {
// use stepId from client, or last set stepId
const payload: Payload = { stepId: current ? current.stepId : currentStepId }
const payload: Payload = { stepId: current && current.stepId.length ? current.stepId : currentStepId }
testRunner(payload, onSuccess)
},
}
Expand Down
6 changes: 5 additions & 1 deletion web-app/src/services/state/actions/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ export default {
return Promise.reject(`Failed to load tutorial config ${error.message}`)
})
},
continueConfig() {
continueConfig(context: CR.MachineContext) {
channel.editorSend({
type: 'EDITOR_TUTORIAL_CONTINUE_CONFIG',
payload: {
// pass position because current stepId or first stepId will be empty
stepId: context.position.stepId,
},
})
},
loadLevel(context: CR.MachineContext): void {
Expand Down