From a90caf699f5312542410d1e2204ccb26f20e2dac Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Tue, 11 Jan 2022 16:42:24 +0100 Subject: [PATCH] rn modal --- .../src/app/plugins/permission-handler-plugin.tsx | 4 ++-- apps/remix-ide/src/app/plugins/remixd-handle.tsx | 6 +++--- apps/remix-ide/src/app/tabs/hardhat-provider.tsx | 4 ++-- libs/remix-core-plugin/src/lib/gist-handler.ts | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx b/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx index ce76cc7cc6..1b947d75dd 100644 --- a/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx +++ b/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx @@ -72,7 +72,7 @@ export class PermissionHandlerPlugin extends Plugin { const { allow, hash } = this.permissions[to.name][method][from.name] if (!allow) { const warning = this.notAllowWarning(from, to, method) - this.call('modal', 'toast', warning) + this.call('notification', 'toast', warning) return false } return hash === from.hash @@ -100,7 +100,7 @@ export class PermissionHandlerPlugin extends Plugin { cancelLabel: 'Decline' } - const result = await this.call('modal', 'modal', modal) + const result = await this.call('notification', 'modal', modal) return new Promise((resolve, reject) => { if (result) { if (this.permissions[to.name][method][from.name]) { diff --git a/apps/remix-ide/src/app/plugins/remixd-handle.tsx b/apps/remix-ide/src/app/plugins/remixd-handle.tsx index 6f4c522647..68367d1df3 100644 --- a/apps/remix-ide/src/app/plugins/remixd-handle.tsx +++ b/apps/remix-ide/src/app/plugins/remixd-handle.tsx @@ -69,7 +69,7 @@ export class RemixdHandle extends WebsocketPlugin { id: 'connectionAlert', 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() } else { const intervalId = setInterval(() => { @@ -80,7 +80,7 @@ export class RemixdHandle extends WebsocketPlugin { id: 'connectionAlert', 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() } }, 3000) @@ -102,7 +102,7 @@ export class RemixdHandle extends WebsocketPlugin { okLabel: 'Connect', cancelLabel: 'Cancel', } - const result = await this.call('modal', 'modal', mod) + const result = await this.call('notification', 'modal', mod) if(result) { try { this.localhostProvider.preInit() diff --git a/apps/remix-ide/src/app/tabs/hardhat-provider.tsx b/apps/remix-ide/src/app/tabs/hardhat-provider.tsx index c84a6d09c2..1ca0547d9a 100644 --- a/apps/remix-ide/src/app/tabs/hardhat-provider.tsx +++ b/apps/remix-ide/src/app/tabs/hardhat-provider.tsx @@ -83,7 +83,7 @@ export class HardhatProvider extends Plugin { }, defaultValue: 'http://127.0.0.1:8545' } - this.call('modal', 'modal', modalContent) + this.call('notification', 'modal', modalContent) }) })() } catch (e) { @@ -114,7 +114,7 @@ export class HardhatProvider extends Plugin { title: 'Hardhat Provider', 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' }) this.provider = null setTimeout(_ => { this.blocked = false }, 1000) // we wait 1 second for letting remix to switch to vm diff --git a/libs/remix-core-plugin/src/lib/gist-handler.ts b/libs/remix-core-plugin/src/lib/gist-handler.ts index 6c22c29aa8..23ea64b937 100644 --- a/libs/remix-core-plugin/src/lib/gist-handler.ts +++ b/libs/remix-core-plugin/src/lib/gist-handler.ts @@ -45,7 +45,7 @@ export class GistHandler extends Plugin { setTimeout(() => reject(new Error('Hide')), 0) } } - this.call('modal', 'modal', modalContent) + this.call('notification', 'modal', modalContent) }) })() } catch (e) { @@ -63,7 +63,7 @@ export class GistHandler extends Plugin { title: 'Gist load error', message: 'Error while loading gist. Please provide a valid Gist ID or URL.' } - this.call('modal', 'alert', modalContent) + this.call('notification', 'alert', modalContent) } } else { const modalContent = { @@ -71,7 +71,7 @@ export class GistHandler extends Plugin { title: 'Gist load error', message: 'Error while loading gist. Id cannot be empty.' } - this.call('modal', 'alert', modalContent) + this.call('notification', 'alert', modalContent) } return loadingFromGist } else { @@ -97,7 +97,7 @@ export class GistHandler extends Plugin { modalType: 'alert', okLabel: 'OK' } - await this.call('modal', 'modal', modalContent) + await this.call('notification', 'modal', modalContent) return } } catch (e: any) { @@ -107,7 +107,7 @@ export class GistHandler extends Plugin { message: e.message } - await this.call('modal', 'alert', modalContent) + await this.call('notification', 'alert', modalContent) return } @@ -124,7 +124,7 @@ export class GistHandler extends Plugin { message: errorSavingFiles.message || errorSavingFiles } - this.call('modal', 'alert', modalContent) + this.call('notification', 'alert', modalContent) } }) })