fix toaster messaging.

pull/5367/head
Joseph Izang 3 weeks ago committed by Aniket
parent 43ba1e4418
commit dbf10882ec
  1. 8
      apps/remix-ide/src/app/tabs/compile-tab.js
  2. 7
      apps/remix-ide/src/app/udapp/run-tab.tsx

@ -99,13 +99,17 @@ class CompileTab extends CompilerApiMixin(ViewPlugin) { // implements ICompilerA
* This function is used by remix-plugin compiler API. * This function is used by remix-plugin compiler API.
* @param {object} settings {evmVersion, optimize, runs, version, language} * @param {object} settings {evmVersion, optimize, runs, version, language}
*/ */
setCompilerConfig (settings) { async setCompilerConfig (settings) {
super.setCompilerConfig(settings) super.setCompilerConfig(settings)
this.renderComponent() this.renderComponent()
// @todo(#2875) should use loading compiler return value to check whether the compiler is loaded instead of "setInterval" // @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') 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) { compile (fileName) {

@ -35,7 +35,8 @@ const profile = {
'setEnvironmentMode', 'setEnvironmentMode',
'clearAllInstances', 'clearAllInstances',
'addInstance', 'addInstance',
'resolveContractAndAddInstance' 'resolveContractAndAddInstance',
'showPluginDetails'
] ]
} }
@ -87,6 +88,10 @@ export class RunTab extends ViewPlugin {
}) })
} }
showPluginDetails() {
return profile
}
async setEnvironmentMode(env) { async setEnvironmentMode(env) {
const canCall = await this.askUserPermission('setEnvironmentMode', 'change the environment used') const canCall = await this.askUserPermission('setEnvironmentMode', 'change the environment used')
if (canCall) { if (canCall) {

Loading…
Cancel
Save