Skip to content

Commit

Permalink
fix #1094: use default template when none is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoferretti committed Oct 26, 2022
1 parent ff2dd23 commit 1470931
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/foam-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
},
{
"command": "foam-vscode.create-note-from-template",
"title": "Foam: Create Note From Template"
"title": "Foam: Create New Note From Template"
},
{
"command": "foam-vscode.create-note-from-default-template",
Expand Down
6 changes: 4 additions & 2 deletions packages/foam-vscode/src/features/commands/create-note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FoamFeature } from '../../types';
import { URI } from '../../core/model/uri';
import {
askUserForTemplate,
getDefaultTemplateUri,
getPathFromTitle,
NoteFactory,
} from '../../services/templates';
Expand Down Expand Up @@ -67,8 +68,9 @@ async function createNote(args: CreateNoteArgs) {
return;
}
} else {
templateUri =
args.templatePath && asAbsoluteWorkspaceUri(URI.file(args.templatePath));
templateUri = args.templatePath
? asAbsoluteWorkspaceUri(URI.file(args.templatePath))
: getDefaultTemplateUri();
}

if (await fileExists(templateUri)) {
Expand Down

0 comments on commit 1470931

Please sign in to comment.