bugfix: create from note overwrite

This commit is contained in:
Gamosoft 2025-11-26 19:20:02 +01:00
parent bafe3a7407
commit ce6d94ad10
1 changed files with 7 additions and 0 deletions

View File

@ -634,6 +634,13 @@ function noteApp() {
notePath = `${targetFolder}/${notePath}`;
}
// CRITICAL: Check if note already exists
const existingNote = this.notes.find(note => note.path === notePath);
if (existingNote) {
alert(`A note named "${this.newTemplateNoteName.trim()}" already exists in this location.\nPlease choose a different name.`);
return;
}
// Create note from template
const response = await fetch('/api/templates/create-note', {
method: 'POST',