diff --git a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx index 59bc8ce7..763559db 100644 --- a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx +++ b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx @@ -133,6 +133,11 @@ const Inputbar: FC = ({ assistant, setActiveTopic }) => { } const addNewTopic = useCallback(async () => { + if (generating) { + window.message.warning({ content: t('message.switch.disabled'), key: 'generating' }) + return + } + const topic = getDefaultTopic(assistant.id) await db.topics.add({ id: topic.id, messages: [] }) @@ -147,7 +152,7 @@ const Inputbar: FC = ({ assistant, setActiveTopic }) => { setActiveTopic(topic) 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 () => { if (generating) {