mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
fix: use default note type when creating folder note from click event
The click event handlers would call `createFolderNote` with an undefined `extension` parameter, which will ultimately lead to the specified Template not being applied due to a mismatch between the actually created and specified file extensions here: 945c25f97e/src/functions/folderNoteFunctions.ts (L112)
This change explicitly sets the extension parameter to whatever is specified in the settings as default, to prevent that error from happening.
This commit is contained in:
parent
c1e7567a6e
commit
c00f9951e6
1 changed files with 2 additions and 2 deletions
|
|
@ -37,7 +37,7 @@ export async function handleViewHeaderClick(event: MouseEvent, plugin: FolderNot
|
|||
return;
|
||||
} else if (event.altKey || Keymap.isModEvent(event) === 'tab') {
|
||||
if ((plugin.settings.altKey && event.altKey) || (plugin.settings.ctrlKey && Keymap.isModEvent(event) === 'tab')) {
|
||||
await createFolderNote(plugin, folderPath, true, undefined, true);
|
||||
await createFolderNote(plugin, folderPath, true, plugin.settings.folderNoteType, true);
|
||||
addCSSClassToTitleEL(folderPath, 'has-folder-note', plugin);
|
||||
removeCSSClassFromEL(folderPath, 'has-not-folder-note', plugin);
|
||||
return;
|
||||
|
|
@ -87,7 +87,7 @@ export async function handleFolderClick(event: MouseEvent, plugin: FolderNotesPl
|
|||
}
|
||||
} else if (event.altKey || Keymap.isModEvent(event) === 'tab') {
|
||||
if ((plugin.settings.altKey && event.altKey) || (plugin.settings.ctrlKey && Keymap.isModEvent(event) === 'tab')) {
|
||||
await createFolderNote(plugin, folderPath, true, undefined, true);
|
||||
await createFolderNote(plugin, folderPath, true, plugin.settings.folderNoteType, true);
|
||||
addCSSClassToTitleEL(folderPath, 'has-folder-note', plugin);
|
||||
removeCSSClassFromEL(folderPath, 'has-not-folder-note', plugin);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue