mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	trigger events after note attributes are created
This commit is contained in:
		| @@ -30,6 +30,7 @@ eventService.subscribe(eventService.NOTE_TITLE_CHANGED, async note => { | ||||
|                 await treeService.sortNotesAlphabetically(parent.noteId); | ||||
|  | ||||
|                 messagingService.sendMessageToAllClients({ type: 'refresh-tree' }); | ||||
|                 break; // sending the message once is enough | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -68,9 +68,6 @@ async function createNewNote(parentNoteId, noteData) { | ||||
|         isExpanded: 0 | ||||
|     }).save(); | ||||
|  | ||||
|     await triggerNoteTitleChanged(note); | ||||
|     await triggerChildNoteCreated(note, parentNote); | ||||
|  | ||||
|     for (const attr of await parentNote.getAttributes()) { | ||||
|         if (attr.name.startsWith("child:")) { | ||||
|             await new Attribute({ | ||||
| @@ -86,6 +83,9 @@ async function createNewNote(parentNoteId, noteData) { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     await triggerNoteTitleChanged(note); | ||||
|     await triggerChildNoteCreated(note, parentNote); | ||||
|  | ||||
|     return { | ||||
|         note, | ||||
|         branch | ||||
|   | ||||
		Reference in New Issue
	
	Block a user