From dbf10882ec0cc2dce9e0e36c7a9adebb19ae8b0a Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Tue, 5 Nov 2024 23:46:41 +0100 Subject: [PATCH] fix toaster messaging. --- apps/remix-ide/src/app/tabs/compile-tab.js | 8 ++++++-- apps/remix-ide/src/app/udapp/run-tab.tsx | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/compile-tab.js b/apps/remix-ide/src/app/tabs/compile-tab.js index 1fb7dea231..70f0d498a7 100644 --- a/apps/remix-ide/src/app/tabs/compile-tab.js +++ b/apps/remix-ide/src/app/tabs/compile-tab.js @@ -99,13 +99,17 @@ class CompileTab extends CompilerApiMixin(ViewPlugin) { // implements ICompilerA * This function is used by remix-plugin compiler API. * @param {object} settings {evmVersion, optimize, runs, version, language} */ - setCompilerConfig (settings) { + async setCompilerConfig (settings) { super.setCompilerConfig(settings) this.renderComponent() // @todo(#2875) should use loading compiler return value to check whether the compiler is loaded instead of "setInterval" const value = JSON.stringify(settings, null, '\t') + let pluginInfo + pluginInfo = await this.call('udapp', 'showPluginDetails') - this.call('notification', 'toast', compilerConfigChangedToastMsg(this.currentRequest.from, value)) + if (this.currentRequest.from === 'udapp') { + this.call('notification', 'toast', compilerConfigChangedToastMsg((pluginInfo ? pluginInfo.displayName : this.currentRequest.from ), value)) + } } compile (fileName) { diff --git a/apps/remix-ide/src/app/udapp/run-tab.tsx b/apps/remix-ide/src/app/udapp/run-tab.tsx index bc811f8aff..b17d95b9c6 100644 --- a/apps/remix-ide/src/app/udapp/run-tab.tsx +++ b/apps/remix-ide/src/app/udapp/run-tab.tsx @@ -35,7 +35,8 @@ const profile = { 'setEnvironmentMode', 'clearAllInstances', 'addInstance', - 'resolveContractAndAddInstance' + 'resolveContractAndAddInstance', + 'showPluginDetails' ] } @@ -87,6 +88,10 @@ export class RunTab extends ViewPlugin { }) } + showPluginDetails() { + return profile + } + async setEnvironmentMode(env) { const canCall = await this.askUserPermission('setEnvironmentMode', 'change the environment used') if (canCall) {