mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 02:02:29 +08:00
fix AiChatButton
This commit is contained in:
parent
aaa3ee2697
commit
a05013c8f4
@ -232,15 +232,10 @@ export default class RootCommandExecutor extends Component {
|
|||||||
|
|
||||||
async createAiChatCommand() {
|
async createAiChatCommand() {
|
||||||
try {
|
try {
|
||||||
// Create a new AI Chat note
|
// Create a new AI Chat note at the root level
|
||||||
const parentNoteId = appContext.tabManager.getActiveContextNotePath();
|
const rootNoteId = "root";
|
||||||
|
|
||||||
if (!parentNoteId) {
|
const result = await noteCreateService.createNote(rootNoteId, {
|
||||||
toastService.showError("No active note to create AI Chat under");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = await noteCreateService.createNote(parentNoteId, {
|
|
||||||
title: "New AI Chat",
|
title: "New AI Chat",
|
||||||
type: "aiChat",
|
type: "aiChat",
|
||||||
content: JSON.stringify({
|
content: JSON.stringify({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user