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.
This commit is contained in:
parent
cbb1173a3d
commit
c527fbdcd2
@ -518,11 +518,9 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic, topic }) =
|
|||||||
}, [isDragging, handleDrag, handleDragEnd])
|
}, [isDragging, handleDrag, handleDragEnd])
|
||||||
|
|
||||||
useShortcut('new_topic', () => {
|
useShortcut('new_topic', () => {
|
||||||
if (!loading) {
|
addNewTopic()
|
||||||
addNewTopic()
|
EventEmitter.emit(EVENT_NAMES.SHOW_TOPIC_SIDEBAR)
|
||||||
EventEmitter.emit(EVENT_NAMES.SHOW_TOPIC_SIDEBAR)
|
textareaRef.current?.focus()
|
||||||
textareaRef.current?.focus()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
useShortcut('clear_topic', () => {
|
useShortcut('clear_topic', () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user