mirror of
https://github.com/hanzoai/code.git
synced 2026-09-30 20:53:35 +00:00
only start a new thread if empty
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user