mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 03:40:33 +08:00
parent
baaf37a8f4
commit
44f7fa09e0
@ -133,6 +133,11 @@ const Inputbar: FC<Props> = ({ assistant, setActiveTopic }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const addNewTopic = useCallback(async () => {
|
const addNewTopic = useCallback(async () => {
|
||||||
|
if (generating) {
|
||||||
|
window.message.warning({ content: t('message.switch.disabled'), key: 'generating' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const topic = getDefaultTopic(assistant.id)
|
const topic = getDefaultTopic(assistant.id)
|
||||||
|
|
||||||
await db.topics.add({ id: topic.id, messages: [] })
|
await db.topics.add({ id: topic.id, messages: [] })
|
||||||
@ -147,7 +152,7 @@ const Inputbar: FC<Props> = ({ assistant, setActiveTopic }) => {
|
|||||||
setActiveTopic(topic)
|
setActiveTopic(topic)
|
||||||
|
|
||||||
clickAssistantToShowTopic && setTimeout(() => EventEmitter.emit(EVENT_NAMES.SHOW_TOPIC_SIDEBAR), 0)
|
clickAssistantToShowTopic && setTimeout(() => EventEmitter.emit(EVENT_NAMES.SHOW_TOPIC_SIDEBAR), 0)
|
||||||
}, [addTopic, assistant, clickAssistantToShowTopic, setActiveTopic, setModel])
|
}, [addTopic, assistant, clickAssistantToShowTopic, generating, setActiveTopic, setModel, t])
|
||||||
|
|
||||||
const clearTopic = async () => {
|
const clearTopic = async () => {
|
||||||
if (generating) {
|
if (generating) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user