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
|
// Command or Ctrl + N create new topic
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const onKeydown = (e) => {
|
const onKeydown = (e) => {
|
||||||
|
if (!generating) {
|
||||||
if ((e.ctrlKey || e.metaKey) && e.key === 'n') {
|
if ((e.ctrlKey || e.metaKey) && e.key === 'n') {
|
||||||
addNewTopic()
|
addNewTopic()
|
||||||
inputRef.current?.focus()
|
inputRef.current?.focus()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
document.addEventListener('keydown', onKeydown)
|
document.addEventListener('keydown', onKeydown)
|
||||||
return () => document.removeEventListener('keydown', onKeydown)
|
return () => document.removeEventListener('keydown', onKeydown)
|
||||||
}, [addNewTopic])
|
}, [addNewTopic, generating])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const unsubscribes = [
|
const unsubscribes = [
|
||||||
|
|||||||
@ -156,7 +156,7 @@ export async function checkApi(provider: Provider) {
|
|||||||
key: 'api-check',
|
key: 'api-check',
|
||||||
style: { marginTop: '3vh' },
|
style: { marginTop: '3vh' },
|
||||||
duration: valid ? 2 : 8,
|
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
|
return valid
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user