Prevent modification of notes directly
This commit is contained in:
parent
815e88cf18
commit
0ba0fa65f4
3 changed files with 51 additions and 19 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue