From db6dbc78211135af9b7ea93d717b1b36e7c9394b Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 18 Dec 2022 20:12:43 +0100 Subject: [PATCH] can't create non-launcher notes into the launcher subtree --- src/services/notes.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/notes.js b/src/services/notes.js index d74e96075..a025efab7 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -104,6 +104,10 @@ function getAndValidateParent(params) { throw new ValidationError(`Creating child notes into launcher notes is not allowed.`); } + if (['lbAvailableLaunchers', 'lbVisibleLaunchers'].includes(params.parentNoteId) && params.type !== 'launcher') { + throw new ValidationError(`Only 'launcher' notes can be created in parent '${params.parentNoteId}'`); + } + if (!params.ignoreForbiddenParents && (['lbRoot', 'hidden'].includes(parentNote.noteId) || parentNote.isOptions())) { throw new ValidationError(`Creating child notes into '${parentNote.noteId}' is not allowed.`); }