fixing modal for consent

aiui_fix
lianahus 12 months ago
parent 9ab946a675
commit 56bfd93b8f
  1. 6
      apps/remixdesktop/src/menus/view.ts
  2. 13
      libs/remix-ui/settings/src/lib/remix-ui-settings.tsx

@ -79,9 +79,9 @@ export default (
accelerator: 'CmdOrCtrl+0',
click: function(item, focusedWindow) {
if (focusedWindow)
{
focusedWindow.webContents.setZoomFactor(1)
}
{
focusedWindow.webContents.setZoomFactor(1)
}
}
},

@ -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)

Loading…
Cancel
Save