fix: can not create new topic on message generation
This commit is contained in:
parent
31fa49095f
commit
03460b4ec8
@ -89,14 +89,16 @@ const Inputbar: FC<Props> = ({ assistant, setActiveTopic }) => {
|
||||
// Command or Ctrl + N create new topic
|
||||
useEffect(() => {
|
||||
const onKeydown = (e) => {
|
||||
if ((e.ctrlKey || e.metaKey) && e.key === 'n') {
|
||||
addNewTopic()
|
||||
inputRef.current?.focus()
|
||||
if (!generating) {
|
||||
if ((e.ctrlKey || e.metaKey) && e.key === 'n') {
|
||||
addNewTopic()
|
||||
inputRef.current?.focus()
|
||||
}
|
||||
}
|
||||
}
|
||||
document.addEventListener('keydown', onKeydown)
|
||||
return () => document.removeEventListener('keydown', onKeydown)
|
||||
}, [addNewTopic])
|
||||
}, [addNewTopic, generating])
|
||||
|
||||
useEffect(() => {
|
||||
const unsubscribes = [
|
||||
|
||||
@ -156,7 +156,7 @@ export async function checkApi(provider: Provider) {
|
||||
key: 'api-check',
|
||||
style: { marginTop: '3vh' },
|
||||
duration: valid ? 2 : 8,
|
||||
content: valid ? t('api.connection.successful') : t('api.connection.failed') + ' ' + errorMessage
|
||||
content: valid ? t('message.api.connection.successful') : t('message.api.connection.failed') + ' ' + errorMessage
|
||||
})
|
||||
|
||||
return valid
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user