mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 05:11:24 +08:00
fix(store): prevent mutation of assistant presets by using spread operator
This commit is contained in:
parent
c97ad627d1
commit
f25142e597
@ -60,7 +60,7 @@ const KnowledgeDirectories: FC<KnowledgeContentProps> = ({ selectedBase, progres
|
||||
}
|
||||
|
||||
const path = await window.api.file.selectFolder()
|
||||
logger.info('Selected directory:', path)
|
||||
logger.info('Selected directory:', { path })
|
||||
path && addDirectory(path)
|
||||
}
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ const assistantsSlice = createSlice({
|
||||
initialState,
|
||||
reducers: {
|
||||
setAssistantPresets: (state, action: PayloadAction<AssistantPreset[]>) => {
|
||||
state.agents = action.payload
|
||||
state.agents = { ...action.payload }
|
||||
},
|
||||
addAssistantPreset: (state, action: PayloadAction<AssistantPreset>) => {
|
||||
state.agents.push(action.payload)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user