From a7036c4593b0ca941051a1b25ff5800ba4a10200 Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 23 Aug 2021 13:25:25 +0200 Subject: [PATCH] solidity as active plugin when code is loaded from url param --- apps/remix-ide/src/app.js | 12 ++++++++---- apps/remix-ide/src/framingService.js | 4 ---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index 81fec34b39..c2f52d9ade 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -495,8 +495,13 @@ Please make a backup of your contracts and start using http://remix.ethereum.org console.log(e) } - // If plugins are loaded from the URL params, we focus on the last one. - if (pluginLoader.current === 'queryParams' && workspace.length > 0) menuicons.select(workspace[workspace.length - 1]) + if (params.code) { + // if code is given in url we focus on solidity plugin + menuicons.select('solidity') + } else { + // If plugins are loaded from the URL params, we focus on the last one. + if (pluginLoader.current === 'queryParams' && workspace.length > 0) menuicons.select(workspace[workspace.length - 1]) + } if (params.call) { const callDetails = params.call.split('//') @@ -516,7 +521,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org const framingService = new FramingService(sidePanel, menuicons, mainview, this._components.resizeFeature) if (params.embed) framingService.embed() + if (params.code) framingService.code() framingService.start(params) - - if (params.code) frameingService.code() } diff --git a/apps/remix-ide/src/framingService.js b/apps/remix-ide/src/framingService.js index 1d222ebe8e..75c217f18a 100644 --- a/apps/remix-ide/src/framingService.js +++ b/apps/remix-ide/src/framingService.js @@ -41,8 +41,4 @@ export class FramingService { this.mainView.minimizeTerminal() this.resizeFeature.hidePanel() } - - code () { - this.verticalIcons.select('solidity') - } }