Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit249dc58

Browse files
committed
continue progress
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent64c3e7a commit249dc58

File tree

7 files changed

+22
-15
lines changed

7 files changed

+22
-15
lines changed

‎src/channel/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ class Channel implements Channel {
185185
config:continueConfig,
186186
alreadyConfigured:true,
187187
})
188+
logger('check stepId on EDITOR_TUTORIAL_CONTINUE_CONFIG',action.payload.stepId)
188189
// update the current stepId on startup
189-
vscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload)
190+
vscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload.stepId)
190191
return
191192
case'EDITOR_VALIDATE_SETUP':
192193
// check workspace is selected
@@ -233,14 +234,14 @@ class Channel implements Channel {
233234
return
234235
// load step actions (git commits, commands, open files)
235236
case'SETUP_ACTIONS':
236-
awaitvscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload)
237-
setupActions(action.payload,this.send)
237+
awaitvscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload.stepId)
238+
setupActions(action.payload.actions,this.send)
238239
return
239240
// load solution step actions (git commits, commands, open files)
240241
case'SOLUTION_ACTIONS':
241-
awaitsolutionActions(action.payload,this.send)
242+
awaitsolutionActions(action.payload.actions,this.send)
242243
// run test following solution to update position
243-
vscode.commands.executeCommand(COMMANDS.RUN_TEST,action.payload)
244+
vscode.commands.executeCommand(COMMANDS.RUN_TEST,action.payload.stepId)
244245
return
245246

246247
default:

‎src/editor/commands.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface CreateCommandProps {
1919
exportconstcreateCommands=({ extensionPath, workspaceState}:CreateCommandProps)=>{
2020
// React panel webview
2121
letwebview:any
22-
letcurrentStepId=''
22+
letcurrentStepId:string|null=''
2323
lettestRunner:any
2424

2525
return{
@@ -67,13 +67,13 @@ export const createCommands = ({ extensionPath, workspaceState }: CreateCommandP
6767
},
6868
})
6969
},
70-
[COMMANDS.SET_CURRENT_STEP]:({stepId}:Payload)=>{
70+
[COMMANDS.SET_CURRENT_STEP]:(stepId:string|null)=>{
7171
// set from last setup stepAction
7272
currentStepId=stepId
7373
},
74-
[COMMANDS.RUN_TEST]:(current:Payload|undefined,onSuccess:()=>void)=>{
74+
[COMMANDS.RUN_TEST]:(stepId:string|null|undefined,onSuccess:()=>void)=>{
7575
// use stepId from client, or last set stepId
76-
constpayload:Payload={stepId:current&&current.stepId.length ?current.stepId :currentStepId}
76+
constpayload:Payload={stepId:stepId??null}
7777
testRunner(payload,onSuccess)
7878
},
7979
}

‎src/services/testRunner/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { clearOutput, displayOutput } from './output'
77
import{formatFailOutput}from'./formatOutput'
88

99
exportinterfacePayload{
10-
stepId:string
10+
stepId:string|null
1111
}
1212

1313
interfaceCallbacks{

‎web-app/src/services/logger/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import{LOG,VERSION,NODE_ENV}from'../../environment'
22

3-
exporttypeLog=string|object
3+
exporttypeLog=string|object|null
44

55
constlogger=(...messages:Log[]):void=>{
66
if(!LOG){

‎web-app/src/services/state/actions/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ const contextActions: ActionFunctionMap<T.MachineContext, T.MachineEvent> = {
230230
error:():any=>null,
231231
}),
232232
//@ts-ignore
233-
checkEmptySteps:send((context:T.MachineContext)=>{
233+
checkLevelCompleted:send((context:T.MachineContext)=>{
234234
// no step id indicates no steps to complete
235235
return{
236236
type:context.position.stepId===null ?'START_COMPLETED_LEVEL' :'START_LEVEL',

‎web-app/src/services/state/actions/editor.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import*asCRfrom'typings'
22
import*asTTfrom'typings/tutorial'
33
import*asselectorsfrom'../../selectors'
4+
importloggerfrom'services/logger'
45

56
exportdefault(editorSend:any)=>({
67
startup():void{
@@ -28,23 +29,28 @@ export default (editorSend: any) => ({
2829
},
2930
loadLevel(context:CR.MachineContext):void{
3031
constlevel:TT.Level=selectors.currentLevel(context)
32+
logger('loadStep',level)
3133
if(level.setup){
3234
// load step actions
3335
editorSend({
3436
type:'SETUP_ACTIONS',
35-
payload:level.setup,
37+
payload:{
38+
actions:level.setup,
39+
stepId:level.steps.length ?level.steps[0].id :null,
40+
},
3641
})
3742
}
3843
},
3944
loadStep(context:CR.MachineContext):void{
4045
conststep:TT.Step|null=selectors.currentStep(context)
46+
logger('loadStep',step)
4147
if(step&&step.setup){
4248
// load step actions
4349
editorSend({
4450
type:'SETUP_ACTIONS',
4551
payload:{
52+
actions:step.setup,
4653
stepId:step.id,
47-
...step.setup,
4854
},
4955
})
5056
}

‎web-app/src/services/state/machine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export const createMachine = (options: any) => {
150150
initial:'Load',
151151
states:{
152152
Load:{
153-
onEntry:['loadLevel','loadStep','checkEmptySteps'],
153+
onEntry:['loadLevel','checkLevelCompleted'],
154154
on:{
155155
START_LEVEL:'Normal',
156156
START_COMPLETED_LEVEL:'LevelComplete',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp