options fixes

This commit is contained in:
zadam
2022-12-08 15:29:14 +01:00
parent 44997f5cd1
commit c22b6b29e0
4 changed files with 14 additions and 7 deletions

View File

@@ -114,14 +114,10 @@ function getAndValidateParent(params) {
throw new Error(`Launchers should not have child notes.`);
}
if (!params.ignoreForbiddenParents && ['lbRoot'].includes(parentNote.noteId)) {
if (!params.ignoreForbiddenParents && (parentNote.isLaunchBarConfig() || parentNote.isOptions())) {
throw new Error(`Creating child notes into '${parentNote.noteId}' is not allowed.`);
}
if (['lbAvailableLaunchers', 'lbVisibleLaunchers'].includes(parentNote.noteId) && params.type !== 'launcher') {
throw new Error(`Creating child notes into '${parentNote.noteId}' is only possible for type 'launcher'.`);
}
return parentNote;
}