fix listening on edirot event

pull/5370/head
yann300 3 years ago
parent 227c9b0955
commit 2bc7d77103
  1. 6
      libs/remix-ui/solidity-compiler/src/lib/actions/compiler.ts
  2. 2
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx

@ -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
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) => {
const currentFileName = api.getConfiguration('currentFile') const currentFileName = api.getConfiguration('currentFile')
currentFile(currentFileName) currentFile(currentFileName)
listenToEvents(compileTabLogic)(dispatch) listenToEvents(compileTabLogic, api)(dispatch)
}, []) }, [])
useEffect(() => { useEffect(() => {

Loading…
Cancel
Save