fix AiChatButton

This commit is contained in:
perf3ct 2025-03-28 20:06:11 +00:00
parent aaa3ee2697
commit a05013c8f4
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232

View File

@ -232,15 +232,10 @@ export default class RootCommandExecutor extends Component {
async createAiChatCommand() {
try {
// Create a new AI Chat note
const parentNoteId = appContext.tabManager.getActiveContextNotePath();
// Create a new AI Chat note at the root level
const rootNoteId = "root";
if (!parentNoteId) {
toastService.showError("No active note to create AI Chat under");
return;
}
const result = await noteCreateService.createNote(parentNoteId, {
const result = await noteCreateService.createNote(rootNoteId, {
title: "New AI Chat",
type: "aiChat",
content: JSON.stringify({