mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-12 00:49:14 +08:00
fix(selection): disable sandbox mode in SelectionService and clean up imports in ActionTranslate component
- Changed sandbox mode from true to false in SelectionService to improve security and functionality. - Removed unnecessary blank line in entryPoint.tsx for cleaner code. - Updated ActionTranslate component to use the new SelectionActionItem type for better type safety.
This commit is contained in:
parent
b15778b16b
commit
65c24a2f4b
@ -1132,7 +1132,7 @@ export class SelectionService {
|
|||||||
preload: join(__dirname, '../preload/index.js'),
|
preload: join(__dirname, '../preload/index.js'),
|
||||||
contextIsolation: true,
|
contextIsolation: true,
|
||||||
nodeIntegration: false,
|
nodeIntegration: false,
|
||||||
sandbox: true,
|
sandbox: false,
|
||||||
devTools: true
|
devTools: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -10,10 +10,10 @@ import useTranslate from '@renderer/hooks/useTranslate'
|
|||||||
import MessageContent from '@renderer/pages/home/Messages/MessageContent'
|
import MessageContent from '@renderer/pages/home/Messages/MessageContent'
|
||||||
import { getDefaultTopic, getDefaultTranslateAssistant } from '@renderer/services/AssistantService'
|
import { getDefaultTopic, getDefaultTranslateAssistant } from '@renderer/services/AssistantService'
|
||||||
import { Assistant, Topic, TranslateLanguage } from '@renderer/types'
|
import { Assistant, Topic, TranslateLanguage } from '@renderer/types'
|
||||||
import type { ActionItem } from '@renderer/types/selectionTypes'
|
|
||||||
import { runAsyncFunction } from '@renderer/utils'
|
import { runAsyncFunction } from '@renderer/utils'
|
||||||
import { abortCompletion } from '@renderer/utils/abortController'
|
import { abortCompletion } from '@renderer/utils/abortController'
|
||||||
import { detectLanguage } from '@renderer/utils/translate'
|
import { detectLanguage } from '@renderer/utils/translate'
|
||||||
|
import type { SelectionActionItem } from '@shared/data/types'
|
||||||
import { Tooltip } from 'antd'
|
import { Tooltip } from 'antd'
|
||||||
import { ArrowRightFromLine, ArrowRightToLine, ChevronDown, CircleHelp, Globe } from 'lucide-react'
|
import { ArrowRightFromLine, ArrowRightToLine, ChevronDown, CircleHelp, Globe } from 'lucide-react'
|
||||||
import { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
import { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||||
@ -23,11 +23,11 @@ import styled from 'styled-components'
|
|||||||
import { processMessages } from './ActionUtils'
|
import { processMessages } from './ActionUtils'
|
||||||
import WindowFooter from './WindowFooter'
|
import WindowFooter from './WindowFooter'
|
||||||
interface Props {
|
interface Props {
|
||||||
action: ActionItem
|
action: SelectionActionItem
|
||||||
scrollToBottom: () => void
|
scrollToBottom: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
const logger = loggerService
|
const logger = loggerService.withContext('ActionTranslate')
|
||||||
|
|
||||||
const ActionTranslate: FC<Props> = ({ action, scrollToBottom }) => {
|
const ActionTranslate: FC<Props> = ({ action, scrollToBottom }) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|||||||
@ -17,7 +17,6 @@ import { PersistGate } from 'redux-persist/integration/react'
|
|||||||
import SelectionActionApp from './SelectionActionApp'
|
import SelectionActionApp from './SelectionActionApp'
|
||||||
|
|
||||||
loggerService.initWindowSource('SelectionActionWindow')
|
loggerService.initWindowSource('SelectionActionWindow')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchChatCompletion depends on this,
|
* fetchChatCompletion depends on this,
|
||||||
* which is not a good design, but we have to add it for now
|
* which is not a good design, but we have to add it for now
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user