Wait for workspace initialization before registering menu items

pull/5370/head
ioedeveloper 3 years ago
parent b50050fe04
commit 0c4104a2bd
  1. 40
      apps/remix-ide/src/remixAppManager.js

@ -135,25 +135,27 @@ export class RemixAppManager extends PluginManager {
}
async registerContextMenuItems () {
await this.call('filePanel', 'registerContextMenuItem', {
id: 'flattener',
name: 'flattenFileCustomAction',
label: 'Flatten',
type: [],
extension: ['.sol'],
path: [],
pattern: [],
sticky: true
})
await this.call('filePanel', 'registerContextMenuItem', {
id: 'optimism-compiler',
name: 'compileCustomAction',
label: 'Compile with Optimism',
type: [],
extension: ['.sol'],
path: [],
pattern: [],
sticky: true
this.on('filePanel', 'workspaceInitializationCompleted', async () => {
await this.call('filePanel', 'registerContextMenuItem', {
id: 'flattener',
name: 'flattenFileCustomAction',
label: 'Flatten',
type: [],
extension: ['.sol'],
path: [],
pattern: [],
sticky: true
})
await this.call('filePanel', 'registerContextMenuItem', {
id: 'optimism-compiler',
name: 'compileCustomAction',
label: 'Compile with Optimism',
type: [],
extension: ['.sol'],
path: [],
pattern: [],
sticky: true
})
})
}
}

Loading…
Cancel
Save