mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	synchronous events, updating title works fully
This commit is contained in:
		| @@ -8,7 +8,7 @@ export default class Component { | ||||
|         this.initialized = Promise.resolve(); | ||||
|     } | ||||
|  | ||||
|     async eventReceived(name, data) { | ||||
|     async eventReceived(name, data, sync = false) { | ||||
|         await this.initialized; | ||||
|  | ||||
| //        console.log(`Received ${name} to ${this.componentId}`); | ||||
| @@ -23,12 +23,16 @@ export default class Component { | ||||
|  | ||||
|         if (propagateToChildren) { | ||||
|             for (const child of this.children) { | ||||
|                 child.eventReceived(name, data); | ||||
|                 let promise = child.eventReceived(name, data, sync); | ||||
|  | ||||
|                 if (sync) { | ||||
|                     await promise; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     trigger(name, data) { | ||||
|         this.appContext.trigger(name, data); | ||||
|     trigger(name, data, sync = false) { | ||||
|         this.appContext.trigger(name, data, sync); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user