readFile only if path defined

pull/2470/head
yann300 2 years ago
parent 998bb565bc
commit f4faa02cd6
  1. 8
      libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts

@ -106,9 +106,11 @@ export class CompileTabLogic {
const sources = { [target]: { content } }
this.event.emit('removeAnnotations')
this.event.emit('startingCompilation')
this.api.readFile(this.configFilePath).then( contentConfig => {
this.compiler.set('configFileContent', contentConfig)
})
if (this.configFilePath) {
this.api.readFile(this.configFilePath).then( contentConfig => {
this.compiler.set('configFileContent', contentConfig)
})
}
// setTimeout fix the animation on chrome... (animation triggered by 'staringCompilation')
setTimeout(() => { this.compiler.compile(sources, target); resolve(true) }, 100)
}).catch((error) => {

Loading…
Cancel
Save