fix: Neuer Chat Button erstellt Session, Ordner drag&drop im KI-Baum
This commit is contained in:
@@ -3,7 +3,7 @@ import { SessionList } from '@/components/ai/SessionList';
|
||||
import { ChatWindow } from '@/components/ai/ChatWindow';
|
||||
import { ResizablePanel } from '@/components/ui/ResizablePanel';
|
||||
import { usePluginToolbarStore } from '@/store/pluginToolbarStore';
|
||||
import { fetchAgents, type AIAgent } from '@/api/ai';
|
||||
import { fetchAgents, createSession, type AIAgent } from '@/api/ai';
|
||||
|
||||
export function AIAssistantPage() {
|
||||
const [activeSessionId, setActiveSessionId] = useState<string | null>(null);
|
||||
@@ -39,7 +39,16 @@ export function AIAssistantPage() {
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
|
||||
</svg>
|
||||
),
|
||||
onClick: () => { setActiveSessionId(null); setMobileView('list'); setRefreshKey(k => k + 1); },
|
||||
onClick: async () => {
|
||||
try {
|
||||
const session = await createSession({ is_sidebar: false });
|
||||
setActiveSessionId(session.id);
|
||||
setMobileView('chat');
|
||||
setRefreshKey(k => k + 1);
|
||||
} catch (e) {
|
||||
console.error('Failed to create session:', e);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'new-folder',
|
||||
|
||||
Reference in New Issue
Block a user