pull/5370/head
lianahus 4 years ago
parent bd56037f79
commit 97396e69d9
  1. 6
      apps/remix-ide/src/app/components/plugin-manager-component.js

@ -105,7 +105,7 @@ class PluginManagerComponent extends ViewPlugin {
async registerFlattener (event) { async registerFlattener (event) {
if (!this.appManager.isActive('solidity')) { await this.appManager.activatePlugin('solidity') } if (!this.appManager.isActive('solidity')) { await this.appManager.activatePlugin('solidity') }
const compiledSuccessfully = await this.call('solidity', 'compileFile', event) const compiledSuccessfully = await this.call('solidity', 'compileFile', event)
const reporCompileIssue = async () => { const reportCompileIssue = async () => {
this.call('fileManager', 'open', event.path[0]) this.call('fileManager', 'open', event.path[0])
addToolTip('Cannot flatten the file. Please make sure it is compiling successfully.') addToolTip('Cannot flatten the file. Please make sure it is compiling successfully.')
await this.call('menuicons', 'select', 'solidity') await this.call('menuicons', 'select', 'solidity')
@ -114,14 +114,14 @@ class PluginManagerComponent extends ViewPlugin {
if (compiledSuccessfully) { if (compiledSuccessfully) {
const res = await this.call('solidity', 'getCompilationResult') const res = await this.call('solidity', 'getCompilationResult')
if (!res) { if (!res) {
reporCompileIssue() reportCompileIssue()
} else { } else {
await this.call('menuicons', 'select', 'flattener') await this.call('menuicons', 'select', 'flattener')
const path = await this.call('flattener', 'flattenAndSave', res) const path = await this.call('flattener', 'flattenAndSave', res)
await this.call('fileManager', 'open', path) await this.call('fileManager', 'open', path)
} }
} else { } else {
reporCompileIssue() reportCompileIssue()
} }
}, 1000) }, 1000)
} }

Loading…
Cancel
Save