mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-06 19:35:44 +02:00
fix new chat
This commit is contained in:
parent
4e8c881246
commit
86c7a7db03
1 changed files with 8 additions and 3 deletions
|
|
@ -1736,9 +1736,14 @@ function App() {
|
|||
}, [activeFileTabId])
|
||||
|
||||
const handleNewChatTab = useCallback(() => {
|
||||
// If current chat tab already has a run, open a new tab
|
||||
const activeTab = chatTabs.find(t => t.id === activeChatTabId)
|
||||
if (activeTab?.runId) {
|
||||
// If there's already an empty "New chat" tab, switch to it
|
||||
const emptyTab = chatTabs.find(t => !t.runId)
|
||||
if (emptyTab) {
|
||||
if (emptyTab.id !== activeChatTabId) {
|
||||
setActiveChatTabId(emptyTab.id)
|
||||
}
|
||||
} else {
|
||||
// Create a new tab
|
||||
const id = newChatTabId()
|
||||
setChatTabs(prev => [...prev, { id, runId: null }])
|
||||
setActiveChatTabId(id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue