converted note type chooser dialog to new pattern

This commit is contained in:
zadam
2022-06-15 00:10:32 +02:00
parent ebd715ca1b
commit 1347d3fcc2
7 changed files with 151 additions and 135 deletions

View File

@@ -75,9 +75,14 @@ async function createNote(parentNotePath, options = {}) {
};
}
async function chooseNoteType() {
return new Promise(res => {
appContext.triggerCommand("chooseNoteType", {callback: res});
});
}
async function createNoteWithTypePrompt(parentNotePath, options = {}) {
const noteTypeChooserDialog = await import('../dialogs/note_type_chooser.js');
const {success, noteType, templateNoteId} = await noteTypeChooserDialog.chooseNoteType();
const {success, noteType, templateNoteId} = await chooseNoteType();
if (!success) {
return;
@@ -121,5 +126,6 @@ async function duplicateSubtree(noteId, parentNotePath) {
export default {
createNote,
createNoteWithTypePrompt,
duplicateSubtree
duplicateSubtree,
chooseNoteType
};