From 30a22faf7a839c77ba95371522c80fe8f0e77e81 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 28 Feb 2024 10:57:17 +0100 Subject: [PATCH] fixing modal for consent --- apps/remixdesktop/src/menus/view.ts | 6 +++--- .../remix-ui/settings/src/lib/remix-ui-settings.tsx | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/remixdesktop/src/menus/view.ts b/apps/remixdesktop/src/menus/view.ts index 0a36d5367b..e488cfa50e 100644 --- a/apps/remixdesktop/src/menus/view.ts +++ b/apps/remixdesktop/src/menus/view.ts @@ -79,9 +79,9 @@ export default ( accelerator: 'CmdOrCtrl+0', click: function(item, focusedWindow) { if (focusedWindow) - { - focusedWindow.webContents.setZoomFactor(1) - } + { + focusedWindow.webContents.setZoomFactor(1) + } } }, diff --git a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx index 6d3e733cd5..aeaa5f8b22 100644 --- a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx +++ b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx @@ -133,7 +133,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { console.log("useEffect on useCopilot") if (props.useCopilot !== null) copilotActivate(props.config, props.useCopilot, dispatch) if (props.useCopilot) { - const a = async () => await onchangeCopilotActivate() + onchangeCopilotActivate() } console.log("useEffect on useCopilot finish") }, [props.useCopilot]) @@ -146,7 +146,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { textWrapEventAction(props.config, props.editor, event.target.checked, dispatch) } - const onchangeCopilotActivate = async () => { + const onchangeCopilotActivate = () => { console.log("onchangeCopilotActivate ", props.useCopilot) if (!props.useCopilot) { copilotActivate(props.config, props.useCopilot, dispatch) @@ -175,8 +175,8 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { id: 'loadcopilotActivate', title: 'Download Solidity copilot', modalType: ModalTypes.default, - okLabel: 'OK', - //cancelLabel: 'Cancel', + okLabel: 'Hide', + cancelLabel: 'Cancel', message, okFn: async() => { consentGivenForAI = CONSENT.GIVEN @@ -195,6 +195,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { } if (consentGivenForAI === CONSENT.NOT_ASKED) { + console.log("CONSENT.NOT_ASKED modal") props.plugin.call('notification', 'modal', modalActivate) } else if (consentGivenForAI === CONSENT.GIVEN) { startCopilot() @@ -202,13 +203,13 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { // NOT_GIVEN } - if (await props.plugin.call('copilot-suggestion', 'status')) { + if (props.plugin.call('copilot-suggestion', 'status')) { copilotActivate(props.config, true, dispatch) } else { props.plugin.call('copilot-suggestion', 'uninstall') copilotActivate(props.config, false, dispatch) } - } + } const onchangeCopilotMaxNewToken = (event) => { copilotMaxNewToken(props.config, parseInt(event.target.value), dispatch)