pull/1917/head
bunsenstraat 3 years ago
parent db43f1926f
commit a90caf699f
  1. 4
      apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx
  2. 6
      apps/remix-ide/src/app/plugins/remixd-handle.tsx
  3. 4
      apps/remix-ide/src/app/tabs/hardhat-provider.tsx
  4. 12
      libs/remix-core-plugin/src/lib/gist-handler.ts

@ -72,7 +72,7 @@ export class PermissionHandlerPlugin extends Plugin {
const { allow, hash } = this.permissions[to.name][method][from.name] const { allow, hash } = this.permissions[to.name][method][from.name]
if (!allow) { if (!allow) {
const warning = this.notAllowWarning(from, to, method) const warning = this.notAllowWarning(from, to, method)
this.call('modal', 'toast', warning) this.call('notification', 'toast', warning)
return false return false
} }
return hash === from.hash return hash === from.hash
@ -100,7 +100,7 @@ export class PermissionHandlerPlugin extends Plugin {
cancelLabel: 'Decline' cancelLabel: 'Decline'
} }
const result = await this.call('modal', 'modal', modal) const result = await this.call('notification', 'modal', modal)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (result) { if (result) {
if (this.permissions[to.name][method][from.name]) { if (this.permissions[to.name][method][from.name]) {

@ -69,7 +69,7 @@ export class RemixdHandle extends WebsocketPlugin {
id: 'connectionAlert', id: 'connectionAlert',
message: 'Cannot connect to the remixd daemon. Please make sure you have the remixd running in the background.' message: 'Cannot connect to the remixd daemon. Please make sure you have the remixd running in the background.'
} }
this.call('modal', 'alert', alert) this.call('notification', 'alert', alert)
this.canceled() this.canceled()
} else { } else {
const intervalId = setInterval(() => { const intervalId = setInterval(() => {
@ -80,7 +80,7 @@ export class RemixdHandle extends WebsocketPlugin {
id: 'connectionAlert', id: 'connectionAlert',
message: 'Connection to remixd terminated.Please make sure remixd is still running in the background.' message: 'Connection to remixd terminated.Please make sure remixd is still running in the background.'
} }
this.call('modal', 'alert', alert) this.call('notification', 'alert', alert)
this.canceled() this.canceled()
} }
}, 3000) }, 3000)
@ -102,7 +102,7 @@ export class RemixdHandle extends WebsocketPlugin {
okLabel: 'Connect', okLabel: 'Connect',
cancelLabel: 'Cancel', cancelLabel: 'Cancel',
} }
const result = await this.call('modal', 'modal', mod) const result = await this.call('notification', 'modal', mod)
if(result) { if(result) {
try { try {
this.localhostProvider.preInit() this.localhostProvider.preInit()

@ -83,7 +83,7 @@ export class HardhatProvider extends Plugin {
}, },
defaultValue: 'http://127.0.0.1:8545' defaultValue: 'http://127.0.0.1:8545'
} }
this.call('modal', 'modal', modalContent) this.call('notification', 'modal', modalContent)
}) })
})() })()
} catch (e) { } catch (e) {
@ -114,7 +114,7 @@ export class HardhatProvider extends Plugin {
title: 'Hardhat Provider', title: 'Hardhat Provider',
message: `Error while connecting to the hardhat provider: ${error.message}`, message: `Error while connecting to the hardhat provider: ${error.message}`,
} }
this.call('modal', 'alert', modalContent) this.call('notification', 'alert', modalContent)
await this.call('udapp', 'setEnvironmentMode', { context: 'vm', fork: 'london' }) await this.call('udapp', 'setEnvironmentMode', { context: 'vm', fork: 'london' })
this.provider = null this.provider = null
setTimeout(_ => { this.blocked = false }, 1000) // we wait 1 second for letting remix to switch to vm setTimeout(_ => { this.blocked = false }, 1000) // we wait 1 second for letting remix to switch to vm

@ -45,7 +45,7 @@ export class GistHandler extends Plugin {
setTimeout(() => reject(new Error('Hide')), 0) setTimeout(() => reject(new Error('Hide')), 0)
} }
} }
this.call('modal', 'modal', modalContent) this.call('notification', 'modal', modalContent)
}) })
})() })()
} catch (e) { } catch (e) {
@ -63,7 +63,7 @@ export class GistHandler extends Plugin {
title: 'Gist load error', title: 'Gist load error',
message: 'Error while loading gist. Please provide a valid Gist ID or URL.' message: 'Error while loading gist. Please provide a valid Gist ID or URL.'
} }
this.call('modal', 'alert', modalContent) this.call('notification', 'alert', modalContent)
} }
} else { } else {
const modalContent = { const modalContent = {
@ -71,7 +71,7 @@ export class GistHandler extends Plugin {
title: 'Gist load error', title: 'Gist load error',
message: 'Error while loading gist. Id cannot be empty.' message: 'Error while loading gist. Id cannot be empty.'
} }
this.call('modal', 'alert', modalContent) this.call('notification', 'alert', modalContent)
} }
return loadingFromGist return loadingFromGist
} else { } else {
@ -97,7 +97,7 @@ export class GistHandler extends Plugin {
modalType: 'alert', modalType: 'alert',
okLabel: 'OK' okLabel: 'OK'
} }
await this.call('modal', 'modal', modalContent) await this.call('notification', 'modal', modalContent)
return return
} }
} catch (e: any) { } catch (e: any) {
@ -107,7 +107,7 @@ export class GistHandler extends Plugin {
message: e.message message: e.message
} }
await this.call('modal', 'alert', modalContent) await this.call('notification', 'alert', modalContent)
return return
} }
@ -124,7 +124,7 @@ export class GistHandler extends Plugin {
message: errorSavingFiles.message || errorSavingFiles message: errorSavingFiles.message || errorSavingFiles
} }
this.call('modal', 'alert', modalContent) this.call('notification', 'alert', modalContent)
} }
}) })
}) })

Loading…
Cancel
Save