From c527fbdcd2240b9225048fa355a2bbaf4cdd4886 Mon Sep 17 00:00:00 2001 From: ousugo Date: Wed, 19 Mar 2025 15:56:38 +0800 Subject: [PATCH] refactor: simplify new topic shortcut logic in Inputbar - Removed loading check in the new topic shortcut to streamline the process of adding a new topic and focusing the textarea. --- src/renderer/src/pages/home/Inputbar/Inputbar.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx index da67816e..82d37ebc 100644 --- a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx +++ b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx @@ -518,11 +518,9 @@ const Inputbar: FC = ({ assistant: _assistant, setActiveTopic, topic }) = }, [isDragging, handleDrag, handleDragEnd]) useShortcut('new_topic', () => { - if (!loading) { - addNewTopic() - EventEmitter.emit(EVENT_NAMES.SHOW_TOPIC_SIDEBAR) - textareaRef.current?.focus() - } + addNewTopic() + EventEmitter.emit(EVENT_NAMES.SHOW_TOPIC_SIDEBAR) + textareaRef.current?.focus() }) useShortcut('clear_topic', () => {