Prevent modification of notes directly

This commit is contained in:
Joscha 2025-02-12 23:37:07 +01:00
parent 815e88cf18
commit 0ba0fa65f4
3 changed files with 51 additions and 19 deletions

View file

@ -129,7 +129,7 @@ function onEditEditorClose(): void {
function onEditEditorFinish(text: string): void {
if (!note.value) return;
note.value.text = text;
notes.setText(segment.id, text);
onEditEditorClose();
}
@ -141,8 +141,8 @@ function onInsertEditorFinish(text: string): void {
if (!note.value) return;
if (insertIndex.value !== undefined) {
const childNote = notes.createNote(text);
note.value.children.splice(insertIndex.value, 0, childNote.id);
const child = notes.createNote(text);
notes.addChild(segment.id, child.id, insertIndex.value);
}
onInsertEditorClose();