Commit c1448308 authored by yann300's avatar yann300

fix listening on edirot event

parent 971f780d
......@@ -26,8 +26,8 @@ export const resetCompilerMode = () => (dispatch: React.Dispatch<any>) => {
})
}
export const listenToEvents = (compileTabLogic) => (dispatch: React.Dispatch<any>) => {
compileTabLogic.on('editor', 'sessionSwitched', () => {
export const listenToEvents = (compileTabLogic, api) => (dispatch: React.Dispatch<any>) => {
api.on('editor', 'sessionSwitched', () => {
dispatch(setEditorMode('sessionSwitched'))
})
......@@ -39,7 +39,7 @@ export const listenToEvents = (compileTabLogic) => (dispatch: React.Dispatch<any
dispatch(setCompilerMode('compilationDuration', speed))
})
compileTabLogic.on('editor', 'contentChanged', () => {
api.on('editor', 'contentChanged', () => {
dispatch(setEditorMode('contentChanged'))
})
......
......@@ -59,7 +59,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
const currentFileName = api.getConfiguration('currentFile')
currentFile(currentFileName)
listenToEvents(compileTabLogic)(dispatch)
listenToEvents(compileTabLogic, api)(dispatch)
}, [])
useEffect(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment