mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Fix create folder note bug
This commit is contained in:
parent
7c455e695c
commit
4fce7adbf0
1 changed files with 4 additions and 2 deletions
|
|
@ -81,8 +81,9 @@ export async function createFolderNote(plugin: FolderNotesPlugin, folderPath: st
|
|||
}
|
||||
file = await plugin.app.vault.create(path, content);
|
||||
} else {
|
||||
file = existingNote;
|
||||
plugin.app.fileManager.renameFile(existingNote, path);
|
||||
file = existingNote;
|
||||
file.path = path;
|
||||
}
|
||||
|
||||
if (openFile) {
|
||||
|
|
@ -92,7 +93,8 @@ export async function createFolderNote(plugin: FolderNotesPlugin, folderPath: st
|
|||
}
|
||||
}
|
||||
|
||||
if (file && !existingNote && plugin.settings.folderNoteType !== '.excalidraw' && extension?.split('.').pop() == plugin.settings.templatePath.split('.').pop()) {
|
||||
const matchingExtension = extension?.split('.').pop() == plugin.settings.templatePath.split('.').pop();
|
||||
if (file && !existingNote && matchingExtension && plugin.settings.folderNoteType !== '.excalidraw') {
|
||||
applyTemplate(plugin, file, leaf, plugin.settings.templatePath);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue