Skip to content

Commit 9153ecc

Browse files
committed
cleanup
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent 18c24b0 commit 9153ecc

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

‎src/channel/index.ts

+4-5
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':
@@ -184,14 +183,14 @@ class Channel implements Channel {
184183

185184
// report back to the webview that setup is complete
186185
this.send({ type: 'TUTORIAL_CONFIGURED' })
187-
return
188186
} catch (e) {
189187
const error = {
190188
type: 'UnknownError',
191189
message: `Location: EditorTutorialConfig.\n\n ${e.message}`,
192190
}
193191
this.send({ type: 'TUTORIAL_CONFIGURE_FAIL', payload: { error } })
194192
}
193+
return
195194
case 'EDITOR_TUTORIAL_CONTINUE_CONFIG':
196195
try {
197196
const tutorialContinue: TT.Tutorial | null = this.context.tutorial.get()
@@ -205,14 +204,14 @@ class Channel implements Channel {
205204
})
206205
// update the current stepId on startup
207206
vscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP, action.payload.stepId)
208-
return
209207
} catch (e) {
210208
const error = {
211209
type: 'UnknownError',
212210
message: `Location: Editor tutorial continue config.\n\n ${e.message}`,
213211
}
214212
this.send({ type: 'CONTINUE_FAILED', payload: { error } })
215213
}
214+
return
216215
case 'EDITOR_VALIDATE_SETUP':
217216
try {
218217
// check workspace is selected
@@ -253,14 +252,14 @@ class Channel implements Channel {
253252
return
254253
}
255254
this.send({ type: 'SETUP_VALIDATED' })
256-
return
257255
} catch (e) {
258256
const error = {
259257
type: 'UknownError',
260258
message: e.message,
261259
}
262260
this.send({ type: 'VALIDATE_SETUP_FAILED', payload: { error } })
263261
}
262+
return
264263
case 'EDITOR_REQUEST_WORKSPACE':
265264
openWorkspace()
266265
return

‎src/services/logger/index.ts

+1-1
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

-2
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

+3
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

+4-1
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)