mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 03:31:24 +08:00
feat: add default timestamps for topic updates
- Added default values for createdAt and updatedAt timestamps when updating topics.
This commit is contained in:
parent
efd89db1c0
commit
11c7cdc749
@ -45,8 +45,8 @@ const assistantsSlice = createSlice({
|
||||
},
|
||||
addTopic: (state, action: PayloadAction<{ assistantId: string; topic: Topic }>) => {
|
||||
const topic = action.payload.topic
|
||||
topic.createdAt = new Date().toISOString()
|
||||
topic.updatedAt = new Date().toISOString()
|
||||
topic.createdAt = topic.createdAt || new Date().toISOString()
|
||||
topic.updatedAt = topic.updatedAt || new Date().toISOString()
|
||||
state.assistants = state.assistants.map((assistant) =>
|
||||
assistant.id === action.payload.assistantId
|
||||
? {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user