diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index f834990ac5..8e796bcc84 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/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 + }) }) } }