Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

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
cleanup action logs
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
ShMcK committed Jan 2, 2022
commit 11365242c355d924239ad18b142878c8073cc1e6
2 changes: 1 addition & 1 deletion web-app/src/services/state/actions/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const updatePosition = assign({
})

export const loadNext = send((context: T.MachineContext): T.Action => {
const level = selectors.currentLevel(context)
const level: TT.Level = selectors.currentLevel(context)
return getNext(context.position, level, context.tutorial?.levels || [])
})

Expand Down
2 changes: 1 addition & 1 deletion web-app/src/services/state/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export const createMachine = (options: any) => {
},
LevelComplete: {
onEntry: ['onLevelComplete'],
onExit: ['testClear', 'incrementLevel'],
onExit: ['testClear'],
on: {
NEXT_LEVEL: 'LoadNext',
KEY_PRESS_ENTER: 'LoadNext',
Expand Down
7 changes: 1 addition & 6 deletions web-app/src/services/state/useStateMachine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ const editorSend = (action: T.Action) =>
const useStateMachine = (): Output => {
const [state, send] = useMachine<T.MachineContext, any>(createMachine({ editorSend }))

const sendWithLog = (action: T.Action): void => {
logger(action)
send(action)
}

// event bus listener
React.useEffect(() => {
const listener = 'message'
Expand Down Expand Up @@ -57,7 +52,7 @@ const useStateMachine = (): Output => {
return {
context: state.context,
route,
send: sendWithLog,
send,
}
}

Expand Down