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>) => { ...@@ -26,8 +26,8 @@ export const resetCompilerMode = () => (dispatch: React.Dispatch<any>) => {
}) })
} }
export const listenToEvents = (compileTabLogic) => (dispatch: React.Dispatch<any>) => { export const listenToEvents = (compileTabLogic, api) => (dispatch: React.Dispatch<any>) => {
compileTabLogic.on('editor', 'sessionSwitched', () => { api.on('editor', 'sessionSwitched', () => {
dispatch(setEditorMode('sessionSwitched')) dispatch(setEditorMode('sessionSwitched'))
}) })
...@@ -39,7 +39,7 @@ export const listenToEvents = (compileTabLogic) => (dispatch: React.Dispatch<any ...@@ -39,7 +39,7 @@ export const listenToEvents = (compileTabLogic) => (dispatch: React.Dispatch<any
dispatch(setCompilerMode('compilationDuration', speed)) dispatch(setCompilerMode('compilationDuration', speed))
}) })
compileTabLogic.on('editor', 'contentChanged', () => { api.on('editor', 'contentChanged', () => {
dispatch(setEditorMode('contentChanged')) dispatch(setEditorMode('contentChanged'))
}) })
......
...@@ -59,7 +59,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { ...@@ -59,7 +59,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
const currentFileName = api.getConfiguration('currentFile') const currentFileName = api.getConfiguration('currentFile')
currentFile(currentFileName) currentFile(currentFileName)
listenToEvents(compileTabLogic)(dispatch) listenToEvents(compileTabLogic, api)(dispatch)
}, []) }, [])
useEffect(() => { 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