mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
only start a new thread if empty
This commit is contained in:
parent
e04d839640
commit
2638d62a24
1 changed files with 3 additions and 2 deletions
|
|
@ -157,7 +157,8 @@ const Sidebar = () => {
|
|||
// if they pressed the + to add a new chat
|
||||
else if (m.type === 'startNewThread') {
|
||||
setIsThreadSelectorOpen(false)
|
||||
startNewThread()
|
||||
if (currentThread?.messages.length !== 0)
|
||||
startNewThread()
|
||||
}
|
||||
|
||||
// if they opened thread selector
|
||||
|
|
@ -168,7 +169,7 @@ const Sidebar = () => {
|
|||
}
|
||||
window.addEventListener('message', listener);
|
||||
return () => { window.removeEventListener('message', listener) }
|
||||
}, [files, selection, startNewThread])
|
||||
}, [files, selection, startNewThread, currentThread])
|
||||
|
||||
|
||||
const formRef = useRef<HTMLFormElement | null>(null)
|
||||
|
|
|
|||
Loading…
Reference in a new issue