fix delete note function just work one time, closes #1101

This commit is contained in:
zadam
2020-06-10 23:43:59 +02:00
parent 2d92b4931a
commit 910bda860c
5 changed files with 31 additions and 62 deletions

View File

@@ -22,7 +22,7 @@ async function resolveNotePath(notePath) {
*
* @return {string[]}
*/
async function getRunPath(notePath) {
async function getRunPath(notePath, logErrors = true) {
utils.assertArguments(notePath);
notePath = notePath.split("-")[0].trim();
@@ -66,10 +66,14 @@ async function getRunPath(notePath) {
}
if (!parents.some(p => p.noteId === parentNoteId)) {
console.debug(utils.now(), "Did not find parent " + parentNoteId + " for child " + childNoteId);
if (logErrors) {
console.log(utils.now(), "Did not find parent " + parentNoteId + " for child " + childNoteId);
}
if (parents.length > 0) {
console.debug(utils.now(), "Available parents:", parents);
if (logErrors) {
console.log(utils.now(), "Available parents:", parents);
}
const someNotePath = await getSomeNotePath(parents[0]);
@@ -86,7 +90,10 @@ async function getRunPath(notePath) {
break;
}
else {
console.log("No parents so no run path.");
if (logErrors) {
console.log("No parents so no run path.");
}
return;
}
}