Skip to content

Commit a23f997

Browse files
committed
cleanup
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent 738fb7a commit a23f997

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

src/channel/index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,14 @@ class Channel implements Channel {
9191
}
9292
// communicate to client the tutorial & stepProgress state
9393
this.send({ type: 'LOAD_STORED_TUTORIAL', payload: { env, tutorial, progress, position } })
94-
95-
return
9694
} catch (e) {
9795
const error = {
9896
type: 'UnknownError',
9997
message: `Location: Editor startup\n\n${e.message}`,
10098
}
10199
this.send({ type: 'EDITOR_STARTUP_FAILED', payload: { error } })
102100
}
101+
return
103102

104103
// clear tutorial local storage
105104
case 'TUTORIAL_CLEAR':
@@ -203,14 +202,14 @@ class Channel implements Channel {
203202

204203
// report back to the webview that setup is complete
205204
this.send({ type: 'TUTORIAL_CONFIGURED' })
206-
return
207205
} catch (e) {
208206
const error = {
209207
type: 'UnknownError',
210208
message: `Location: EditorTutorialConfig.\n\n ${e.message}`,
211209
}
212210
this.send({ type: 'TUTORIAL_CONFIGURE_FAIL', payload: { error } })
213211
}
212+
return
214213
case 'EDITOR_TUTORIAL_CONTINUE_CONFIG':
215214
try {
216215
const tutorialContinue: TT.Tutorial | null = this.context.tutorial.get()
@@ -224,14 +223,14 @@ class Channel implements Channel {
224223
})
225224
// update the current stepId on startup
226225
vscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP, action.payload.stepId)
227-
return
228226
} catch (e) {
229227
const error = {
230228
type: 'UnknownError',
231229
message: `Location: Editor tutorial continue config.\n\n ${e.message}`,
232230
}
233231
this.send({ type: 'CONTINUE_FAILED', payload: { error } })
234232
}
233+
return
235234
case 'EDITOR_VALIDATE_SETUP':
236235
try {
237236
// check workspace is selected
@@ -272,14 +271,14 @@ class Channel implements Channel {
272271
return
273272
}
274273
this.send({ type: 'SETUP_VALIDATED' })
275-
return
276274
} catch (e) {
277275
const error = {
278276
type: 'UknownError',
279277
message: e.message,
280278
}
281279
this.send({ type: 'VALIDATE_SETUP_FAILED', payload: { error } })
282280
}
281+
return
283282
case 'EDITOR_REQUEST_WORKSPACE':
284283
openWorkspace()
285284
return

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 } from '../../environment'
22

3-
export type Log = string | object
3+
export type Log = string | object | null
44

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

web-app/src/containers/Tutorial/Level/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ const Level = ({ level, onContinue, onLoadSolution, processes, testStatus }: Pro
9191
currentStep = level.steps.length
9292
}
9393

94-
console.log(`currentStep: ${currentStep}`)
95-
9694
const pageBottomRef = React.useRef(null)
9795

9896
const scrollToBottom = () => {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as TT from 'typings/tutorial'
33
import { assign, send, ActionFunctionMap } from 'xstate'
44
import * as selectors from '../../selectors'
55
import onError from '../../../services/sentry/onError'
6+
import logger from 'services/logger'
67

78
const contextActions: ActionFunctionMap<T.MachineContext, T.MachineEvent> = {
89
// @ts-ignore
@@ -100,6 +101,8 @@ const contextActions: ActionFunctionMap<T.MachineContext, T.MachineEvent> = {
100101

101102
progress.levels[levelId] = true
102103

104+
logger('PROGRESS', progress)
105+
103106
return progress
104107
},
105108
}),

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ export const createMachine = (options: any) => {
160160
onEntry: ['loadLevel', 'checkLevelCompleted'],
161161
on: {
162162
START_LEVEL: 'Normal',
163-
START_COMPLETED_LEVEL: 'LevelComplete',
163+
START_COMPLETED_LEVEL: {
164+
target: 'LevelComplete',
165+
actions: ['updateLevelProgress'],
166+
},
164167
},
165168
},
166169
Normal: {

0 commit comments

Comments
 (0)