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

Commit18c24b0

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

File tree

7 files changed

+21
-15
lines changed

7 files changed

+21
-15
lines changed

‎src/channel/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class Channel implements Channel {
204204
alreadyConfigured:true,
205205
})
206206
// update the current stepId on startup
207-
vscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload)
207+
vscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload.stepId)
208208
return
209209
}catch(e){
210210
consterror={
@@ -266,14 +266,14 @@ class Channel implements Channel {
266266
return
267267
// load step actions (git commits, commands, open files)
268268
case'SETUP_ACTIONS':
269-
awaitvscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload)
270-
setupActions(action.payload,this.send)
269+
awaitvscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload.stepId)
270+
setupActions(action.payload.actions,this.send)
271271
return
272272
// load solution step actions (git commits, commands, open files)
273273
case'SOLUTION_ACTIONS':
274-
awaitsolutionActions(action.payload,this.send)
274+
awaitsolutionActions(action.payload.actions,this.send)
275275
// run test following solution to update position
276-
vscode.commands.executeCommand(COMMANDS.RUN_TEST,action.payload)
276+
vscode.commands.executeCommand(COMMANDS.RUN_TEST,action.payload.stepId)
277277
return
278278

279279
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
@@ -157,7 +157,7 @@ export const createMachine = (options: any) => {
157157
initial:'Load',
158158
states:{
159159
Load:{
160-
onEntry:['loadLevel','loadStep','checkEmptySteps'],
160+
onEntry:['loadLevel','checkLevelCompleted'],
161161
on:{
162162
START_LEVEL:'Normal',
163163
START_COMPLETED_LEVEL:'LevelComplete',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp