mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 02:20:10 +08:00
fix: sync active topic after rename (#6804)
Co-authored-by: Chen Tao <70054568+eeee0717@users.noreply.github.com>
This commit is contained in:
parent
74f72fa5b6
commit
dcdf49a5ce
@ -174,7 +174,9 @@ const Topics: FC<Props> = ({ assistant: _assistant, activeTopic, setActiveTopic
|
|||||||
if (messages.length >= 2) {
|
if (messages.length >= 2) {
|
||||||
const summaryText = await fetchMessagesSummary({ messages, assistant })
|
const summaryText = await fetchMessagesSummary({ messages, assistant })
|
||||||
if (summaryText) {
|
if (summaryText) {
|
||||||
updateTopic({ ...topic, name: summaryText, isNameManuallyEdited: false })
|
const updatedTopic = { ...topic, name: summaryText, isNameManuallyEdited: false }
|
||||||
|
updateTopic(updatedTopic)
|
||||||
|
topic.id === activeTopic.id && setActiveTopic(updatedTopic)
|
||||||
} else {
|
} else {
|
||||||
window.message?.error(t('message.error.fetchTopicName'))
|
window.message?.error(t('message.error.fetchTopicName'))
|
||||||
}
|
}
|
||||||
@ -192,7 +194,9 @@ const Topics: FC<Props> = ({ assistant: _assistant, activeTopic, setActiveTopic
|
|||||||
defaultValue: topic?.name || ''
|
defaultValue: topic?.name || ''
|
||||||
})
|
})
|
||||||
if (name && topic?.name !== name) {
|
if (name && topic?.name !== name) {
|
||||||
updateTopic({ ...topic, name, isNameManuallyEdited: true })
|
const updatedTopic = { ...topic, name, isNameManuallyEdited: true }
|
||||||
|
updateTopic(updatedTopic)
|
||||||
|
topic.id === activeTopic.id && setActiveTopic(updatedTopic)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user