From 1cae86f93d299e92017e80b052af29e37ba138aa Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Mon, 25 Nov 2024 14:09:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A8=A1=E5=9E=8B=E5=9B=9E=E7=AD=94?= =?UTF-8?q?=E6=97=B6=E5=8F=AF=E4=BB=A5=E6=96=B0=E5=BB=BA=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=20#369?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #369 --- src/renderer/src/pages/home/Inputbar/Inputbar.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) {