Commit ebbebb41 authored by lianahus's avatar lianahus

added save to the action (wip)

parent 4e9299bd
......@@ -105,10 +105,10 @@ class PluginManagerComponent extends ViewPlugin {
async registerFlattener (event) {
if (!this.appManager.isActive('solidity')) { await this.appManager.activatePlugin('solidity') }
const compiledSuccessfully = await this.call('solidity', 'compileFile', event)
const reporCompileIssue = () => {
const reporCompileIssue = async () => {
this.call('fileManager', 'open', event.path[0])
addToolTip('Cannot flatten the file. Please make sure it is compiling successfully.')
this.call('menuicons', 'select', 'solidity')
await this.call('menuicons', 'select', 'solidity')
}
setTimeout(async () => {
if (compiledSuccessfully) {
......@@ -116,8 +116,9 @@ class PluginManagerComponent extends ViewPlugin {
if (!res) {
reporCompileIssue()
} else {
this.call('menuicons', 'select', 'flattener1')
await this.call('flattener1', 'flatten', res)
await this.call('menuicons', 'select', 'flattener1')
const path = await this.call('flattener1', 'flattenAndSave', res)
await this.call('fileManager', 'open', path)
}
} else {
reporCompileIssue()
......@@ -125,8 +126,8 @@ class PluginManagerComponent extends ViewPlugin {
}, 1000)
}
onActivation () {
this.call('filePanel', 'registerContextMenuItem', {
async onActivation () {
await this.call('filePanel', 'registerContextMenuItem', {
id: 'pluginManager',
name: 'registerFlattener',
label: 'Flatten',
......
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