mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +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); |                 await treeService.sortNotesAlphabetically(parent.noteId); | ||||||
|  |  | ||||||
|                 messagingService.sendMessageToAllClients({ type: 'refresh-tree' }); |                 messagingService.sendMessageToAllClients({ type: 'refresh-tree' }); | ||||||
|  |                 break; // sending the message once is enough | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -68,9 +68,6 @@ async function createNewNote(parentNoteId, noteData) { | |||||||
|         isExpanded: 0 |         isExpanded: 0 | ||||||
|     }).save(); |     }).save(); | ||||||
|  |  | ||||||
|     await triggerNoteTitleChanged(note); |  | ||||||
|     await triggerChildNoteCreated(note, parentNote); |  | ||||||
|  |  | ||||||
|     for (const attr of await parentNote.getAttributes()) { |     for (const attr of await parentNote.getAttributes()) { | ||||||
|         if (attr.name.startsWith("child:")) { |         if (attr.name.startsWith("child:")) { | ||||||
|             await new Attribute({ |             await new Attribute({ | ||||||
| @@ -86,6 +83,9 @@ async function createNewNote(parentNoteId, noteData) { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     await triggerNoteTitleChanged(note); | ||||||
|  |     await triggerChildNoteCreated(note, parentNote); | ||||||
|  |  | ||||||
|     return { |     return { | ||||||
|         note, |         note, | ||||||
|         branch |         branch | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user