mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 03:10:08 +08:00
refactor(translate): remove deprecated redux actions and types
The translate slice actions and types have been migrated elsewhere, so they are removed from this file. The file is marked as deprecated.
This commit is contained in:
parent
2bd5f39740
commit
9a67ac9018
@ -1,10 +1,9 @@
|
||||
import type { PayloadAction } from '@reduxjs/toolkit'
|
||||
/** @deprecated All migrated. */
|
||||
import { createSlice } from '@reduxjs/toolkit'
|
||||
|
||||
export interface TranslateState {
|
||||
translateInput: string
|
||||
translatedContent: string
|
||||
// TODO: #9749
|
||||
settings: {
|
||||
autoCopy: boolean
|
||||
}
|
||||
@ -22,19 +21,17 @@ const translateSlice = createSlice({
|
||||
name: 'translate',
|
||||
initialState,
|
||||
reducers: {
|
||||
setTranslateInput: (state, action: PayloadAction<string>) => {
|
||||
state.translateInput = action.payload
|
||||
},
|
||||
setTranslatedContent: (state, action: PayloadAction<string>) => {
|
||||
state.translatedContent = action.payload
|
||||
},
|
||||
updateSettings: (state, action: PayloadAction<Partial<TranslateState['settings']>>) => {
|
||||
const update = action.payload
|
||||
Object.assign(state.settings, update)
|
||||
}
|
||||
// setTranslateInput: (state, action: PayloadAction<string>) => {
|
||||
// state.translateInput = action.payload
|
||||
// },
|
||||
// setTranslatedContent: (state, action: PayloadAction<string>) => {
|
||||
// state.translatedContent = action.payload
|
||||
// },
|
||||
// updateSettings: (state, action: PayloadAction<Partial<TranslateState['settings']>>) => {
|
||||
// const update = action.payload
|
||||
// Object.assign(state.settings, update)
|
||||
// }
|
||||
}
|
||||
})
|
||||
|
||||
export const { setTranslateInput, setTranslatedContent, updateSettings } = translateSlice.actions
|
||||
|
||||
export default translateSlice.reducer
|
||||
|
||||
Loading…
Reference in New Issue
Block a user