fix registering 'contentChanged' event

pull/1342/head
yann300 3 years ago committed by davidzagi93@gmail.com
parent c3f8846405
commit e804389da0
  1. 10
      apps/solidity-compiler/src/app/compiler-api.ts

@ -158,10 +158,10 @@ export const CompilerApiMixin = (Base) => class extends Base {
} }
listenToEvents () { listenToEvents () {
this.data.eventHandlers.onContentChanged = () => { this.on('editor', 'contentChanged', () => {
this.emit('statusChanged', { key: 'edited', title: 'the content has changed, needs recompilation', type: 'info' }) this.emit('statusChanged', { key: 'edited', title: 'the content has changed, needs recompilation', type: 'info' })
} if (this.onContentChanged) this.onContentChanged()
this.on('editor', 'contentChanged', this.data.eventHandlers.onContentChanged) })
this.data.eventHandlers.onLoadingCompiler = () => { this.data.eventHandlers.onLoadingCompiler = () => {
this.data.loading = true this.data.loading = true
@ -197,10 +197,6 @@ export const CompilerApiMixin = (Base) => class extends Base {
if (this.onSessionSwitched) this.onSessionSwitched() if (this.onSessionSwitched) this.onSessionSwitched()
}) })
this.on('editor', 'contentChanged', () => {
if (this.onContentChanged) this.onContentChanged()
})
this.compileTabLogic.event.on('startingCompilation', this.data.eventHandlers.onStartingCompilation) this.compileTabLogic.event.on('startingCompilation', this.data.eventHandlers.onStartingCompilation)
this.compileTabLogic.event.on('removeAnnotations', this.data.eventHandlers.onRemoveAnnotations) this.compileTabLogic.event.on('removeAnnotations', this.data.eventHandlers.onRemoveAnnotations)

Loading…
Cancel
Save